類別 Rinda::TupleSpaceProxy

TupleSpaceProxy 允許遠端 Tuplespace 顯示為本機。

公開類別方法

new(ts) 按一下以切換來源

建立新的 TupleSpaceProxy 以封裝 ts

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

公開執行個體方法

notify(ev, tuple, sec=nil) 按一下以切換來源

註冊代理 TupleSpace 上事件 ev 的通知。請參閱 TupleSpace#notify

# File lib/rinda/rinda.rb, line 298
def notify(ev, tuple, sec=nil)
  @ts.notify(ev, tuple, sec)
end
read(tuple, sec=nil, &block) 按一下以切換來源

從代理 TupleSpace 讀取 tuple。請參閱 TupleSpace#read

# File lib/rinda/rinda.rb, line 282
def read(tuple, sec=nil, &block)
  @ts.read(tuple, sec, &block)
end
read_all(tuple) 按一下以切換來源

從代理 TupleSpace 讀取與 tuple 相符的所有元組。請參閱 TupleSpace#read_all

# File lib/rinda/rinda.rb, line 290
def read_all(tuple)
  @ts.read_all(tuple)
end
take(tuple, sec=nil, &block) 按一下以切換來源

從代理 TupleSpace 取用 tuple。請參閱 TupleSpace#take

# File lib/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) 按一下以切換來源

tuple 新增至代理 TupleSpace。請參閱 TupleSpace#write

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