Skip to content

Turbo.lua

Turbo is a framework built for LuaJIT 2 to simplify the task of building fast and scalable network applications. It uses a event-driven, non-blocking, no thread design to deliver excellent performance and minimal footprint to high-load applications while also providing excellent support for embedded uses. The toolkit can be used for HTTP REST API's, traditional dynamic web pages through templating, open connections like WebSockets, or just as high level building blocks for native speed network applications.

First and foremost the framework is aimed at the HTTP(S) protocol. This means web developers and HTTP API developers are the first class citizens. But the framework contains generic nuts and bolts such as; a I/O loop, IO Stream classes, customizeable TCP (with SSL) server classes giving it value for everyone doing any kind of high performance network application. It will also speak directly to your exising C libraries, and happily also create native C struct's for the ultimate memory and CPU performance.

Keep in mind that running this with LuaJIT provides you with roughly the speed of compiled C code with only a fraction of the development time. Perfect for small devices running cheap CPU's on battery power as well as your pay per use Amazon cluster.

LuaJIT 2 is REQUIRED, PUC-RIO Lua is unsupported.

API Documentation is available at https://turbo.readthedocs.io, or it can be built from source with make html from /doc in the source tree.

It's main features and design principles are:

  • Simple and intuitive API (much like Tornado).
  • Low-level operations is possible if the users wishes that.
  • Implemented in straight Lua and LuaJIT FFI on Linux, so the user can study and modify inner workings without too much effort. The Windows implementation uses some Lua modules to make compability possible.
  • Good documentation
  • Event driven, asynchronous and threadless design
  • Small footprint
  • SSL support (requires OpenSSL or LuaSec module for Windows)

Troubleshooting

luarocks install prefix

luarocks install turbo를 사용하여 설치할 경우 rocks의 기본경로(/usr/loacl)가 다를경우 정상적으로 설치되지 않는 현상이 발생할 수 있다.

이 경우 Turbo의 make파일을 직접 수정하거나, 해당 파일1을 참고하여 관련 환경변수를 직접 전달해야 한다.

$ PREFIX="$PREFIX" CPATH="$PREFIX/include" LIBRARY_PATH="$PREFIX/lib" luarocks install turbo

참고로 luarocks에 CFLAGS를 전달할 경우 관련 환경변수가 전파되지 않을 수 있다. 대신 CPATH를 사용하여 Include 경로를 전달할 수 있다.

See also

Favorite site

References