Class: Rinda::TupleSpaceProxy
- Inherits:
-
Object
- Object
- Rinda::TupleSpaceProxy
- Defined in:
- lib/rinda/rinda.rb
Overview
TupleSpaceProxy allows a remote Tuplespace to appear as local.
Defined Under Namespace
Classes: Port
Instance Method Summary collapse
-
#initialize(ts) ⇒ TupleSpaceProxy
constructor
Creates a new TupleSpaceProxy to wrap
ts
. -
#notify(ev, tuple, sec = nil) ⇒ Object
Registers for notifications of event
ev
on the proxied TupleSpace. -
#read(tuple, sec = nil, &block) ⇒ Object
Reads
tuple
from the proxied TupleSpace. -
#read_all(tuple) ⇒ Object
Reads all tuples matching
tuple
from the proxied TupleSpace. -
#take(tuple, sec = nil, &block) ⇒ Object
Takes
tuple
from the proxied TupleSpace. -
#write(tuple, sec = nil) ⇒ Object
Adds
tuple
to the proxied TupleSpace.
Constructor Details
#initialize(ts) ⇒ TupleSpaceProxy
Creates a new TupleSpaceProxy to wrap ts
.
257 258 259 |
# File 'lib/rinda/rinda.rb', line 257 def initialize(ts) @ts = ts end |
Instance Method Details
#notify(ev, tuple, sec = nil) ⇒ Object
Registers for notifications of event ev
on the proxied TupleSpace. See TupleSpace#notify
296 297 298 |
# File 'lib/rinda/rinda.rb', line 296 def notify(ev, tuple, sec=nil) @ts.notify(ev, tuple, sec) end |
#read(tuple, sec = nil, &block) ⇒ Object
Reads tuple
from the proxied TupleSpace. See TupleSpace#read.
280 281 282 |
# File 'lib/rinda/rinda.rb', line 280 def read(tuple, sec=nil, &block) @ts.read(tuple, sec, &block) end |
#read_all(tuple) ⇒ Object
Reads all tuples matching tuple
from the proxied TupleSpace. See TupleSpace#read_all.
288 289 290 |
# File 'lib/rinda/rinda.rb', line 288 def read_all(tuple) @ts.read_all(tuple) end |
#take(tuple, sec = nil, &block) ⇒ Object
Takes tuple
from the proxied TupleSpace. See TupleSpace#take.
271 272 273 274 275 |
# File 'lib/rinda/rinda.rb', line 271 def take(tuple, sec=nil, &block) Port.deliver do |port| @ts.move(DRbObject.new(port), tuple, sec, &block) end end |
#write(tuple, sec = nil) ⇒ Object
Adds tuple
to the proxied TupleSpace. See TupleSpace#write.
264 265 266 |
# File 'lib/rinda/rinda.rb', line 264 def write(tuple, sec=nil) @ts.write(tuple, sec) end |