W3cubDocs

/Ruby 2.4

class Rinda::TupleSpaceProxy

Parent:
Object

TupleSpaceProxy allows a remote Tuplespace to appear as local.

Public Class Methods

new(ts) Show source

Creates a new TupleSpaceProxy to wrap ts.

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

Public Instance Methods

notify(ev, tuple, sec=nil) Show source

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

# File lib/rinda/rinda.rb, line 296
def notify(ev, tuple, sec=nil)
  @ts.notify(ev, tuple, sec)
end
read(tuple, sec=nil, &block) Show source

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

# File lib/rinda/rinda.rb, line 280
def read(tuple, sec=nil, &block)
  @ts.read(tuple, sec, &block)
end
read_all(tuple) Show source

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

# File lib/rinda/rinda.rb, line 288
def read_all(tuple)
  @ts.read_all(tuple)
end
take(tuple, sec=nil, &block) Show source

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

# 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) Show source

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

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

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.