win32utils-devel@rubyforge.org
2004-Oct-22 23:52 UTC
[Win32utils-devel] win32-ipc idea - allow a block
Hi all, What do you think about allowing a block to the various wait methods in win32-ipc? These could be fired off if signalled, e.g. i = IPC.new i.wait{ puts "We got a signal!" } That way, you wouldn''t constantly have to check the return value. Make sense? Or not? Regards, Dan
win32utils-devel@rubyforge.org
2004-Oct-23 05:50 UTC
[Win32utils-devel] win32-ipc idea - allow a block
Hi Dan,> What do you think about allowing a block to the various wait methods > in win32-ipc? These could be fired off if signalled, e.g. > > i = IPC.new > i.wait{ puts "We got a signal!" }Makes perfect sense to me ... this is very Rubyisque :-)> That way, you wouldn''t constantly have to check the return value. > Make sense? Or not?I thought wait( ) would take in a list (array) of objects on which it is waiting and an optional timeout parameter. At least that is how Perl does it, I think. So I am not sure how to really use this class. All I would say is keep both forms: block form as well as "check the return value later" form. HTH, -- shanko