Looks nice but, why would I use this instead of openresty ?<p>If I were looking for a stand-alone -no nginx- solution: Why would I use this instead of lev[1] or luvit[2] ?<p>[1] <a href="https://github.com/connectFree/lev/" rel="nofollow">https://github.com/connectFree/lev/</a><p>[2] <a href="https://luvit.io/" rel="nofollow">https://luvit.io/</a>
Recently I was made aware of one gotcha of using lua/luajit from multiple threads (with lua/luajit vm context per thread). And the problem is simply due to underlying libc thread safety which I (finally) understood why Python did with it's global (per all VM's in the process) lock.<p>Simply - things like getenv() are not-thread safe, and not guaranteed to be if there is setenv(). Not lua/luajit's fault, but might be seen as such (higher level language, supposed to guard folks from things like that).<p>It suddenly changed my thinking of VM's in general and their interaction with the standard library and the OS.<p>(One can say maybe every function from libc/msvcrt/etc. must be thread-safe, but then there are things like errno, or getenv() returning pointer).
Announcement with more details can be found here : <a href="http://permalink.gmane.org/gmane.comp.lang.lua.general/116266" rel="nofollow">http://permalink.gmane.org/gmane.comp.lang.lua.general/11626...</a>
Speaking of Lua, here is a Lua 5.1 source code guide from creator of LuaJIT [1].
Really nice open source codebase to learn from.<p>[1] <a href="http://www.reddit.com/comments/63hth/ask_reddit_which_oss_codebases_out_there_are_so/c02pxbp" rel="nofollow">http://www.reddit.com/comments/63hth/ask_reddit_which_oss_co...</a>
At a time when nginx (at least the commercial version) is starting to emphasize nginx+javascript instead of nginx+lua, it's interesting to see a project try the opposite approach: take the nginx+lua combination and replace nginx with more lua.
The code features some extensive use of coroutines: <a href="https://github.com/kingluo/luajit.io/blob/master/lib/ljio/socket/tcp.lua#L23" rel="nofollow">https://github.com/kingluo/luajit.io/blob/master/lib/ljio/so...</a><p>I wonder how nice they are to use compared to threads, or even to node-style CPS.