Rinda::NotifyTemplateEntry

class Rinda::NotifyTemplateEntry

Parent:
Rinda::TemplateEntry

A NotifyTemplateEntry is returned by Rinda::TupleSpace#notify and is notified of TupleSpace changes. You may receive either your subscribed event or the 'close' event when iterating over notifications.

See Rinda::TupleSpace#notify_event for valid notification types.

Example

ts = Rinda::TupleSpace.new
observer = ts.notify 'write', [nil]

Thread.start do
  observer.each { |t| p t }
end

3.times { |i| ts.write [i] }

Outputs:

登录查看完整内容