youbbs
youbbs
5896 2 0

aLiLua:一个lua web 框架

aLiLua 是一套基于 epoll/kqueue/Lua 构建的网络服务开发框架
aLiLua 使用 epoll 进行网络/文件IO事件读写,对Lua协程进行调度,其性能高效并且简单

http://alilua.com/
https://github.com/oneoo/alilua

example

local db = mysql:new()
local db_ok, err, errno, sqlstate = db:connect({
					host = "localhost",
					port = 3306,
					pool_size = 256,
					database = "db",
					user = "user",
					password = "***"})
if not db_ok then
	header('HTTP/1.1 503 ServerError')
	die('MySQL Connection Error.')
end
 
local res, err, errno, sqlstate = db:query("SELECT * FROM t1 LIMIT 1")
if not res then
	echo("bad result: ", err, ": ", errno, ": ", sqlstate, ".")
else
	echo("result: ", json_encode(res)..'\n')
end
0

See Also

Nearby


Discussion (2)

ego008
ego008 2018-03-08 14:58

luvit 被忽视的lua 高性能框架 https://github.com/luvit/lit

0
放牛哥
放牛哥 2018-03-13 06:13

@ego008 嗯嗯

0
Login Topics