Created
November 3, 2012 22:07
-
-
Save havenwood/4009037 to your computer and use it in GitHub Desktop.
DCell Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dcell/explorer' | |
DCell.start id: 'wooly', | |
addr: 'tcp://127.0.0.1:1111' | |
DCell.start id: 'mammoth', | |
addr: 'tcp://127.0.0.1:1112', | |
description: { id: 'mammoth', addr: 'tcp://127.0.0.1:1111' } | |
module DCell | |
class Cell | |
include Celluloid | |
def run | |
5.downto 1 do |n| | |
puts "#{n}..." | |
sleep 5 | |
end | |
end | |
end | |
end | |
cell = DCell::Cell.new | |
cell.run! # cell.async.run syntax not implemented in dcell yet | |
DCell::Explorer.new 'localhost', 8080 | |
# open localhost:8080 in a browser for dcell stats |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment