Comment on Lapis – A Lua, Moonscript Framework built on OpenRestyparentComments−fab13n12yI 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).
Comments
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).