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.
(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).
Comments
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.
You can use https://github.com/openresty/lua-nginx-module#ngxlocationcap... to do multiple parallel requests
Interesting. Thank you!
I 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, 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).