local sock = http.socket.new(acceptor:accept())
local req = http.request.new()
local res = http.response.new()

res.status = 200
res.reason = 'OK'
res.body = 'Hello World\n'

while true do
    sock:read_request(req)
    while sock.read_state ~= 'finished' do sock:read_some(req) end

    sock:write_response(res)
end
Execution engine

Emilua strives to be the most complete execution engine for Lua. Whether you want single-VM concurrency support to exploit complex async IO interactions or multi-VM support to exploit possible parallelism your needs should be covered.

Fibers

Avoid the callback-hell syndrome, and enjoy tried-and-true sync primitives when you opt for shared-memory concurrency. Emilua offers a complete fiber API. You don’t need to migrate to Lua 5.4 to enjoy cleanup handlers (to-be-closed variables). Use cleanup handlers directly from LuaJIT instead.

Cross-platform

Emilua is powered by the battle-tested and scar-accumulating Boost.Asio library to drive IO and it’ll make use of native APIs in a long list of supported platforms (but you’ll have to compile Emilua from source as we don’t provide any pre-built binaries). And processor ISA support will be limited by LuaJIT availability.

Network IO
IPC
Filesystem API
Misc