[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to wait for both sockets and timers in a coroutine dispatcher.
- From: Renato Maia <maia@...>
- Date: Fri, 6 Jan 2012 11:50:43 -0200
On 5 Jan 2012, at 23:35, Sam Roberts wrote:
> Its annoying, but your best bet is for your coroutine to yield with
> the amount of time it wants to "sleep".
That's exactly what's done by the LOOP's thread scheduler. If you want to check it out see:
http://loop.luaforge.net/library/thread/SocketScheduler.html
http://loop.luaforge.net/library/thread/CoSocket.html (socket support)
http://loop.luaforge.net/library/thread/Scheduler.html (see function 'suspend([time])')
--
Renato Maia
Computer Scientist
PUC-Rio
__________________________
http://www.inf.puc-rio.br/~maia/