-
-
Save practicingruby/4114108 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "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