On 25 Sep 2005, at 17:49, Mark Volkmann wrote: > I'm trying to determine what the methods "move" and "notify" do in the > Rinda class TupleSpace defined in lib/ruby/1.8/rinda/tuplespace.rb. I > don't see any mention of these in the articles I've found on Rinda. I > thought I could just look at the source and figure it out. Wrong! That > code is pretty complicated and is insufficiently commented in my > opinion. > > If anyone knows what those methods do, even if it's just a guess, I'd > love to hear it! The 'move' method is unimportant, you'll probably never call it directly. Look at TupleSpace#take and TupleSpaceProxy for how it is used. notify works like this: ## # A NotifyTemplateEntry is returned by TupleSpace#notify and is notified of # TupleSpace changes. You may receive either your subscribed event or the # 'close' event when iterating over notifications. # # See 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: # # ['write', [0]] # ['write', [1]] # ['write', [2]] class NotifyTemplateEntry < TemplateEntry ... end ... class TupleSpace ... ## # Registers for notifications of +event+. Returns a NotifyTemplateEntry. # See NotifyTemplateEntry for examples of how to listen for notifications. # # +event+ can be: # 'write':: A tuple was added # 'take':: A tuple was taken or moved # 'delete':: A tuple was lost after being overwritten or expiring # # The TupleSpace will also notify you of the 'close' event when the # NotifyTemplateEntry has expired. def notify(event, tuple, sec=nil) -- Eric Hodel - drbrain / segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04