class Rinda::TupleSpaceProxy

TupleSpaceProxy allows a remote Tuplespace to appear as local.

Public Class Methods

new(ts) click to toggle source

Creates a new TupleSpaceProxy to wrap ts.

# File rinda/rinda.rb, line 259
def initialize(ts)
  @ts = ts
end

Public Instance Methods

notify(ev, tuple, sec=nil) click to toggle source

Registers for notifications of event ev on the proxied TupleSpace. See TupleSpace#notify

# File rinda/rinda.rb, line 298
def notify(ev, tuple, sec=nil)
  @ts.notify(ev, tuple, sec)
end
read(tuple, sec=nil, &block) click to toggle source

Reads tuple from the proxied TupleSpace. See TupleSpace#read.

# File rinda/rinda.rb, line 282
def read(tuple, sec=nil, &block)
  @ts.read(tuple, sec, &block)
end
read_all(tuple) click to toggle source

Reads all tuples matching tuple from the proxied TupleSpace. See TupleSpace#read_all.

# File rinda/rinda.rb, line 290
def read_all(tuple)
  @ts.read_all(tuple)
end
take(tuple, sec=nil, &block) click to toggle source

Takes tuple from the proxied TupleSpace. See TupleSpace#take.

# File rinda/rinda.rb, line 273
def take(tuple, sec=nil, &block)
  Port.deliver do |port|
    @ts.move(DRbObject.new(port), tuple, sec, &block)
  end
end
write(tuple, sec=nil) click to toggle source

Adds tuple to the proxied TupleSpace. See TupleSpace#write.

# File rinda/rinda.rb, line 266
def write(tuple, sec=nil)
  @ts.write(tuple, sec)
end