On 11/11/07, Roger Pack <rogerpack2005 at gmail.com>
wrote:>
> if I add something to next_tick that constantly adds itself to
> next_tick, how often is that run, exactly? Is it only run on a
> network state change, or is it constantly polled?
It will always run on the next pass through the reactor core. There''s
no
delay, however. The reactor will notice that there is a next_tick pending
and will run it without waiting.
#next_tick is useful for a lot of things. One of them is to avoid filling up
outbound network buffers too much (and stressing the memory system). That
works because if you some data and then schedule the rest to be written on a
next_tick, the reactor will cycle and the kernel will have a chance to drain
the outbound data.
Also I am still rather in the dark as to how spawned processes
work> and how they interact with network events and the EM. Any help?
Read the howto documents in the distro: LIGHTWEIGHT_CONCURRENCY,
SPAWNED_PROCESSES, and DEFERRABLE.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071111/03ddfd6e/attachment.html