class Rinda::TupleSpaceProxy

TupleSpaceProxy 允许远程的元组空间看起来像本地的。

公共类方法

new(ts) 点击切换源码

创建一个新的 TupleSpaceProxy 来包装 ts

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

公共实例方法

notify(ev, tuple, sec=nil) 点击切换源码

在代理的 TupleSpace 上注册事件 ev 的通知。请参阅 TupleSpace#notify

# File rinda-0.2.0/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 rinda-0.2.0/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 rinda-0.2.0/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 rinda-0.2.0/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 rinda-0.2.0/lib/rinda/rinda.rb, line 266
def write(tuple, sec=nil)
  @ts.write(tuple, sec)
end