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.

Lua-enabled

Emilua adopts the only approach able to offer an execution engine that will not crash no matter how many Lua features you mix in (coroutines, modules, errors, …​). The secret sauce is to encode all the knowledge from these interactions in the same single runtime.

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.

Still growing

Need a feature not available yet? Emilua is young and still evolving. Reach for the paid support and a team of experienced & highly-skilled developers will be looking into your problems. Or just check the ROADMAP to see what features will eventually make into the public source code repository anyway if you can spare to wait.

Misc