Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created November 3, 2012 22:07
Show Gist options
  • Save havenwood/4009037 to your computer and use it in GitHub Desktop.
Save havenwood/4009037 to your computer and use it in GitHub Desktop.
DCell Example
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