As known, nginx modules are static linking.
Of course, you could also use dynamic modules, but they are limited to use dynamic symbols from nginx executable.
What if I need to use static variables and functions from nginx executable in my code?
Asynchronous programming or async for short, is a concurrent programming model supported by an increasing number of programming languages. It lets you run a large number of concurrent tasks on a small number of OS threads, while preserving much of the look and feel of ordinary synchronous programming, through the async/await syntax.
lua-resty-ffi provides an efficient and generic API to do hybrid programming in openresty with mainstream languages (Go, Python, Java, Rust, Nodejs, etc.).
https://github.com/kingluo/lua-resty-ffi
I already implement code hot-reload for Python and Nodejs in lua-resty-ffi.
The Java class reloading is the last piece of the puzzle.
As known, Node.js is a popular javascript runtime based on V8 and libuv, with many third-party packages managed by npm.
How to enable nodejs in openresty, so that we could reuse its rich ecosystem?
Check https://github.com/kingluo/lua-resty-ffi/tree/main/examples/nodejs for source code.
lua-resty-ffi https://github.com/kingluo/lua-resty-ffi
Back in 2019, when I work as individual postgresql/nginx consultant. Many clients ask me if they could do hybrid programming in nginx.
They said, nginx/openresty is powerful and high performance, but the most significant drawback is it lacks of ecosystem of mainstream programming languages, especially when they have to interact with popular frameworks, e.