The openresty API is a little clunky, but works fairly well: http://wiki.nginx.org/HttpLuaModule#ngx.thread.spawn
On Sun, Nov 2, 2014 at 8:05 PM, Ross Bencina <[email protected]> wrote: > On 3/11/2014 7:36 AM, Eike Decker wrote: > >> I'd vote for coroutine based programming. The closure based async >> programing in node.js is driving me nuts. Perfectly simple goals becomes >> stretched and teared like warm chewing gum when jumping through just a >> few asnyc hoops. >> > > Being able to use standard control structures across blocking async calls > is a big advantage of coroutines. > > But i'm not sure whether coroutines *always* provide the best solution. > For example, I'm not sure how you do scatter-gather parallel requests with > Lua coroutines (i.e. issue a bunch of parallel requests, then receive each > reply, then continue the coroutine once all replies have been received). > Would you spawn a coroutine for each request and then join them somehow? > Maybe it would be desirable to have async callbacks available so that > people can implement this kind of thing if/when needed. > > Cheers, > > Ross. > > > -- > You received this message because you are subscribed to the Google Groups > "luvit" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "luvit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
