From Baidu translation.
Lua5.4/luajit of Nginx-Unit support. It can run the Lor/Vanilla frameworks and make targeted openresty adaptation.
Only the HTTP function is preliminarily realized. Only tested on MacOS.
Lua is not integrated into Unit like those languages officially supported by Unit,
It is in the form of an external application (the configuration type is external
).
When the Unit starts (or when the application configuration changes), start the Lua application process according to the configuration. Interact with the Unit communication module that has been compiled into the Lua shared library. The Unit main process will start three functional process controllers, routers and application prototypes, And several application processes, and various processes communicate with each other.
build/
The source code and dependencies required to build the library.lib/
Library files that the runtime depends on.config/
Runtime and app configurations.frameworks/
App dependent framework.apps/
App 。unitd.lua
UNIT service management, viewing status and configuration, and app startup entry.dependence:
Compile build/deps/base64
:
build/deps/
,MacOS
: modify ./Makefile
, comment out the $(OBJCOPY)
instruction under the target lib/libbase64.o
, # Generate files lib/libbase64.o, lib/config.h
# x86
SSSE3_CFLAGS=-mssse3 \
SSE41_CFLAGS=-msse4.1 \
SSE42_CFLAGS=-msse4.2 \
AVX2_CFLAGS=-mavx2 \
AVX_CFLAGS=-mavx \
make lib/libbase64.o
(cd test; make test) # Execute test and benchmark
Build nginx-unit-lua
:
cd ..
# For lua5.4 generate ./Makefile and Makefile of each shared library
# Compile configuration: ./make/inc.lua and make.lua in each shared library directory
# luajit make.lua
./make.lua # -g generate debug information, -r release
make
make clean
UNIT-ROOT/
:
config/config.lua
configures UNIT, registers frameworks and apps../unitd.lua
for management, you can specify the following commands:
[i[nfo]]
Default command, view the list of available commands and registered appsr[estart], s[tart], q[uit]
Manage unitdv[host] [APP-NAME/No.]
View the current vhost configuration of UNIT in JSON formatd[etail] [APP-NAME/No.]
If there is no parameter, all the registered apps' information will be listed.
If the app parameter is specified, its registration information, configuration information, NGX configuration and vhost configuration will be displayed.u[pdate] [APP-NAME/No.]
Process and update the vhosts configuration of the UNIT.g[et] <APP-NAME/No.>
Get request testSign in to post a comment
Activity
Community
Health
Trend
Influence
:Code submit frequency
:React/respond to issue & PR etc.
:Well-balanced team members and collaboration
:Recent popularity of project
:Star counts, download counts etc.
Repository Comments ( 0 )