类 Rinda::TupleSpaceProxy

TupleSpaceProxy 允许远程元组空间表现为本地。

公共类方法

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