Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created November 19, 2012 21:30
Show Gist options
  • Select an option

  • Save practicingruby/4114108 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/4114108 to your computer and use it in GitHub Desktop.
require "celluloid"
class Cell
include Celluloid
def initialize
@pheremone = 0
# .. other variables
end
attr_accessor :ant, :pheremone
end
# elsewhere
cell = Cell.new
cell.exclusive do
# read and write to cell in here...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment