4 ms·
I was just looking at this yesterday. It seems awesome. My one question is how you do forking dependency graphs since everything is non blocking but looks block
by pspeter3 12y ago
I was just looking at this yesterday. It seems awesome. My one question is how you do forking dependency graphs since everything is non blocking but looks blocking. Eg. I have takes A, B and C. C depends on A and B so I want to do A and B concurrently but then wait on them for C.
- fab13n 12y agoI don't know how Lapis does it, but it's not difficult to write a coroutine-cloning function in C for Lua: http://lua-users.org/lists/lua-l/2006-01/threads.html#00650 http://lua-users.org/lists/lua-l/2006-01/threads.html#00650, cf. thread "coroutine.clone and stateful web applications". (Coroutines are essentially one-shot continuations; if you can clone them, you can bookmark execution states at will. Look at Lua's upvalue semantics to anticipate what will happen to variables shared by multiple coroutine clones).
- justincormack 12y agoYou can use https://github.com/openresty/lua-nginx-module#ngxlocationcapture_multi https://github.com/openresty/lua-nginx-module#ngxlocationcap... to do multiple parallel requests
- pspeter3 12y agoInteresting. Thank you!