On Jun 29, 2008, at 3:57 PM, Tony Arcieri wrote:
> On Sat, Jun 28, 2008 at 5:44 PM, Roger Pack <roger.pack at
leadmediapartners.com
> > wrote:
> Also within the run function, should it set @running to false at the
> end of the function?
>
> Yes, and a Rev::Loop#running? method should probably be added.
>
> Also do you want me to write these to rev talk?
Should I handle it?
Also I think what might be really ideal for helping it with
interoperability with other ruby threads would be a run that just
blocks up to a certain time. Kind of like the timeout value passed to
select.
so something like
loop.run_once_until s #seconds
Then you could have every s seconds control [possibly] pass back to
other running ruby threads. Otherwise with 1.8.6 it''s either loop
using 100% CPU and run_once, or loop_once, sleep, and repeat --
somewhat non ideal.
The only reason I even care is that I was writing some specs and
wanted to write a test where it closes asynchronously [faking an
incoming connection that causes it to close]. And realized the
difficulty.
Thanks!
-R
>
> Yes, too bad I didn''t see this until now... good idea! I already
> responded to your other messages separately, but if you can cross-
> post your replies to rev-talk that''d be great.
>
> --
> Tony Arcieri
> medioh.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/rev-talk/attachments/20080630/8e4a9405/attachment-0001.html>