Class: Rinda::WaitTemplateEntry
- Inherits:
-
TemplateEntry
- Object
- TupleEntry
- TemplateEntry
- Rinda::WaitTemplateEntry
- Defined in:
- lib/rinda/tuplespace.rb
Overview
Documentation?
Instance Attribute Summary collapse
-
#found ⇒ Object
readonly
Returns the value of attribute found.
Attributes inherited from TupleEntry
Instance Method Summary collapse
- #cancel ⇒ Object
-
#initialize(place, ary, expires = nil) ⇒ WaitTemplateEntry
constructor
A new instance of WaitTemplateEntry.
- #read(tuple) ⇒ Object
- #signal ⇒ Object
- #wait ⇒ Object
Methods inherited from TemplateEntry
Methods inherited from TupleEntry
#[], #alive?, #canceled?, #expired?, #fetch, #make_expires, #make_tuple, #renew, #size, #value
Constructor Details
#initialize(place, ary, expires = nil) ⇒ WaitTemplateEntry
Returns a new instance of WaitTemplateEntry.
186 187 188 189 190 191 |
# File 'lib/rinda/tuplespace.rb', line 186 def initialize(place, ary, expires=nil) super(ary, expires) @place = place @cond = place.new_cond @found = nil end |
Instance Attribute Details
#found ⇒ Object (readonly)
Returns the value of attribute found.
184 185 186 |
# File 'lib/rinda/tuplespace.rb', line 184 def found @found end |
Instance Method Details
#cancel ⇒ Object
193 194 195 196 |
# File 'lib/rinda/tuplespace.rb', line 193 def cancel super signal end |
#read(tuple) ⇒ Object
202 203 204 205 |
# File 'lib/rinda/tuplespace.rb', line 202 def read(tuple) @found = tuple signal end |
#signal ⇒ Object
207 208 209 210 211 |
# File 'lib/rinda/tuplespace.rb', line 207 def signal @place.synchronize do @cond.signal end end |
#wait ⇒ Object
198 199 200 |
# File 'lib/rinda/tuplespace.rb', line 198 def wait @cond.wait end |