On Wednesday 13, Fabio Mascarenhas wrote: > On Wed, Apr 13, 2011 at 5:11 PM, Alexander Gladysh <[email protected]> wrote: > > What can be done with WSAPI (any one option will resolve my problem): > > > > 1. Fix signal handling (maybe can be done by fiddling with select(), > > maybe not). > > > > and / or > > > > 2. Allow user to replace socket.select() (or whatever WSAPI uses in > > dispatcher) with lua-ev loop. > > > > and / or > > > > 3. Allow user to specify extra socket / file handle / whatever to be > > put into dispatcher. > > > > and / or > > > > 4. Allow user to specify a timeout after which a custom handler would > > be called (copas does something like that). > > I think we are talking past each other. What I am trying to say is > that I do not see a way to add the features you need to every WSAPI > connector without dragging several other dependencies, and event > handling/threading/async is currently very messy in Lua. But adding > the capability to do what you want is not difficult if you are willing > to bite the bullet and include the necessary dependencies: > > https://gist.github.com/918768 > > This uses Robert's threading library and 0MQ binding, so will also > work with LuaJIT. Farm blocking stuff to the helper threads that send > messages to the application when they have stuff for the app to do. > The application checks its inbox whenever it is idle.
Interesting. Thanks for sharing. -- Robert G. Jakabosky _______________________________________________ Kepler-Project mailing list [email protected] http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/
