在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):pguillory/luajit-libuv开源软件地址(OpenSource Url):https://github.com/pguillory/luajit-libuv开源编程语言(OpenSource Language):Lua 96.3%开源软件介绍(OpenSource Introduction):luajit-libuvThis project provides a LuaJIT FFI binding to libuv, the async I/O library powering Node.js. It uses Lua coroutines to provide non-blocking I/O with synchronous syntax. For example, you can build a web server that performs I/O (like reading a file or talking to a database) while generating each response, and it will process multiple requests simultaneously. local http = require 'uv.http'
local fs = require 'uv.fs'
http.listen('127.0.0.1', 8080, function(request)
return { status = 200, body = fs.readfile('README.md') }
end) Or you can perform multiple HTTP requests simultaneously. local http = require 'uv.http'
local parallel = require 'uv.parallel'
local requests = {
{ url = 'http://www.google.com/' },
{ url = 'http://www.bing.com/' },
{ url = 'http://www.amazon.com/' },
}
local responses = parallel.map(requests, http.request) StatusNot production ready. Under active development. The API is unstable. Requirements
Installationgit clone https://github.com/pguillory/luajit-libuv.git
cd luajit-libuv
make
make install API ReferenceFunctions are divided into submodules. Each submodule can either be required directly or accessed indirectly through the local fs = require 'uv.fs'
local uv = require 'uv'
local fs = uv.fs
ContributingYour contributions are welcome! Please verify that See AlsoOther people have done things like this. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论