Sha256: 09487026c91ddcc11e2f0d6224458e70a1e18b0cf03b6427a6fe796eb2aa1e0c

Contents?: true

Size: 343 Bytes

Versions: 7

Compression:

Stored size: 343 Bytes

Contents

#!/usr/bin/env ruby
require 'dcell'

DCell.start :id => "itchy", :addr => "tcp://127.0.0.1:9001"

class Itchy
  include Celluloid

  def initialize
    puts "Ready for mayhem!"
    @n = 0
  end

  def fight
    @n = (@n % 6) + 1
    if @n <= 3
      puts "Bite!"
    else
      puts "Fight!"
    end
  end
end

Itchy.supervise_as :itchy
sleep

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dcell-0.16.0 examples/itchy.rb
dcell-0.16.0.pre examples/itchy.rb
dcell-0.15.0 examples/itchy.rb
dcell-0.15.0.pre examples/itchy.rb
dcell-0.14.0 examples/itchy.rb
dcell-0.13.0 examples/itchy.rb
dcell-0.13.0.pre examples/itchy.rb