123456789_123456789_123456789_123456789_123456789_

Class: Rinda::TupleSpaceProxy

Relationships & Source Files
Inherits: Object
Defined in: lib/rinda/rinda.rb

Overview

TupleSpaceProxy allows a remote Tuplespace to appear as local.

Class Method Summary

Instance Method Summary

Constructor Details

.new(ts) ⇒ TupleSpaceProxy

Creates a new TupleSpaceProxy to wrap ts.

[ GitHub ]

  
# File 'lib/rinda/rinda.rb', line 258

def initialize(ts)
  @ts = ts
end

Instance Method Details

#notify(ev, tuple, sec = nil)

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

[ GitHub ]

  
# File 'lib/rinda/rinda.rb', line 297

def notify(ev, tuple, sec=nil)
  @ts.notify(ev, tuple, sec)
end

#read(tuple, sec = nil, &block)

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

[ GitHub ]

  
# File 'lib/rinda/rinda.rb', line 281

def read(tuple, sec=nil, &block)
  @ts.read(tuple, sec, &block)
end

#read_all(tuple)

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

[ GitHub ]

  
# File 'lib/rinda/rinda.rb', line 289

def read_all(tuple)
  @ts.read_all(tuple)
end

#take(tuple, sec = nil, &block)

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

[ GitHub ]

  
# File 'lib/rinda/rinda.rb', line 272

def take(tuple, sec=nil, &block)
  Port.deliver do |port|
    @ts.move(DRbObject.new(port), tuple, sec, &block)
  end
end

#write(tuple, sec = nil)

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

[ GitHub ]

  
# File 'lib/rinda/rinda.rb', line 265

def write(tuple, sec=nil)
  @ts.write(tuple, sec)
end