Luvit's neglected Lua High performance framework (imitation Nodejs)
SOURCE https://www.cnblogs.com/rongfengliang/p/7856329.html
Luvit open mode and Nodejs, but because of the ecological and minority language problems, the use of less people, but from the current update speed is relatively fast, but from the existing LUA development framework is generally inclined to use the Nginx+lua model, although it is said that Luvit performance than Nodejs is still high, there is no more widespread popularity of 1. Installation
curl -L https://github.com/luvit/lit/raw/master/get-lit.sh | sh
2. Simple code
local http = require(‘http‘)http.createServer(function (req, res) local body = ‘Hello world\n‘ res:setHeader(‘Content-Type‘, ‘text/plain‘) res:setHeader("Content-Length", #body) res:finish(body)end):listen(1337, ‘0.0.0.0‘)print(‘Server running at http://127.0.0.1:1337/‘)
3. Description
尽管没有普及,但是模式以及贡献的一些lua 类库对于我们还是比较有帮助的比如: luv 类库一个异步,多线程模型类库,可以通过luarocks 安装
Reference documents
https://luvit.io/docs.htmlhttps://github.com/luvit/luvithttp://docs.libuv.org/en/v1.x/
Luvit's neglected Lua High performance framework (imitation Nodejs)