normalperson at yhbt.net
Mon Dec 7 15:02:34 EST 2009
Alexander <insinium at gmail.com> wrote:
> Please, could anybody explain how to create simple long polling app
> with rainbows?
I'm not sure if anybody has actually written one for Rainbows!, but I
think they usually include sleeping or using async.callback like
For the concurrency models that appear synchronous, you can check out
t/sleep.ru in the test cases for sleep examples:
when :FiberPool, :FiberSpawn
else # :ThreadPool, :ThreadSpawn
I may put that logic into a env["async.sleep"] callback in places where
env["async.callback"] is not available so the synchronous-looking
concurrency models can all share the same code.
If you're using EventMachine, NeverBlock (and in future versions: Rev,
RevThreadSpawn, RevThreadPool, EventMachineDefer,
EventMachineThreadSpawn), you can use "async.callback" or just use
async_synatra which uses "async.callback" internally.
More information about the rainbows-talk