Skip to content
raksoras edited this page May 13, 2015 · 9 revisions

Luaw stands for "Lua web server". It also matches abbreviation for an air traffic controller command "Line Up And Wait" that closely resembles the way it handles multiple requests using event loop :)

Luaw is an event driven, non blocking IO based HTTP application server inspired by node.js. It uses node.js's excellent async library libuv to do non-blocking IO but instead of Javascript it uses Lua as its primary language for application development. Luaw takes advantage of Lua's first class coroutine support to avoid callback spaghetti problem. This makes writing async IO code as straight forward as writing sequential code while all the heavy-lifting of application state management is transparently handled by Lua coroutines. This mean a Luaw application developer gets best of both worlds - scale of event driven IO and code simplicity of blocking IO.

Features

  1. Full HTTP 1.1 support with persistent/keep-alive connections and HTTP pipelining with configurable connect and read timeouts.
  2. Two ways to read and parse incoming HTTP requests,
    • Reading whole request in memory and then parsing it which is suitable for majority of applications.
    • Reading request as a stream and parsing it as it arrives in parts to minimize latency and server memory footprint for high traffic, high performance applications like HTTP proxies or HTTP load balancers.
  3. Similarly on the output side it supports,
    • Buffering entire content in memory before writing it out to client with the correct "Content-Length" header, or
    • Streaming response continuously as it is generated using HTTP 1.1 chunked encoding to keep server memory pressure minimum.
  4. Fully asynchronous DNS and HTTP client for making remote HTTP calls from server
  5. Sinatra like web application framework that supports mapping URLs to REST resources with full support for path and query parameters.
  6. Luaw template views for server side dynamic content generation. Luaw template views use streaming output with chunked encoding described above to eliminate need for huge server side memory buffers to buffer output generated by the templates.
  7. Support for spawning user threads that can hook into Luaw's async IO machinery for calling multiple backend services from Luaw server in parallel.
  8. Support for user timers for implementing periodic cron like jobs inside Luaw server.
  9. Log4j like logging framework with configurable log levels, log file size limits and automatic log rotation that integrates with syslog out of the box.
  10. MessagePack like library to efficiently serialize/deserialize arbitrarily complex data into compact and portable binary format for remote web service calls.
  11. Built in multipart file upload support