Class: Rinda::TupleSpace
- Inherits:
-
Object
- Object
- Rinda::TupleSpace
- Defined in:
- lib/rinda-patch.rb
Instance Method Summary collapse
-
#initialize(period = 60) ⇒ TupleSpace
constructor
A new instance of TupleSpace.
- #writeID(tuple, sec = nil) ⇒ Object
Constructor Details
#initialize(period = 60) ⇒ TupleSpace
Returns a new instance of TupleSpace.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/rinda-patch.rb', line 5 def initialize(period=60) super() @bag = TupleBag.new @read_waiter = TupleBag.new @take_waiter = TupleBag.new @notify_waiter = TupleBag.new @period = period @keeper = nil @id = 0 end |
Instance Method Details
#writeID(tuple, sec = nil) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/rinda-patch.rb', line 17 def writeID(tuple,sec=nil) synchronize do @id =@id+1 tuple["id"] = @id write(tuple,sec) @id end end |