在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):xjdrew/levent开源软件地址(OpenSource Url):https://github.com/xjdrew/levent开源编程语言(OpenSource Language):C 49.9%开源软件介绍(OpenSource Introduction):leventlevent is a lua concurrency networking library inspired by gevent. Features include:
levent is licensed under MIT license. get leventInstall lua 5.3 or newer(for lua5.2 and older, see branch lua5.2). Clone the repository. Post feedback and issues on the bug tracker, buildNeed cmake 2.8 or newer. Modify cmake.config properly and then run:
ways to build on windows, ref to blog code examplelevent's api is clean, to request http concurrently is as simple as below: lua <<SCRIPT
local levent = require "levent.levent"
local http = require "levent.http"
local urls = {
"http://www.google.com",
"http://yahoo.com",
"http://example.com",
"http://qq.com",
}
function request(url)
local response, err = http.get(url)
if not response then
print(url, "error:", err)
else
print(url, response:get_code())
end
end
function main()
for _, url in ipairs(urls) do
levent.spawn(request, url)
end
end
levent.start(main)
SCRIPT running teststhere are some tests and examples under
documentscoming soon~~ licenceThe MIT License (MIT) Copyright (c) 2014 xjdrew |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论