Proposal: Hybrid programming with lua-resty-ffi
lua-resty-ffi provides an efficient and generic API to do hybrid programming in openresty with mainstream languages (Go, Python, Java, Rust, Node.js, etc.).
Features:
- nonblocking, in coroutine way
- simple but extensible interface, supports any C ABI compliant language
- once and for all, no need to write C/Lua codes to do coupling anymore
- high performance, faster than unix domain socket way
- generic loader library for python/java
- any serialization message format you like
Please refer to: https://github.com/kingluo/lua-resty-ffi
Also, check this blog post for more descriptions:
Implement Grpc Client in Rust for Openresty
I hope I could merge this library into openresty. It's meaningful to extend the ecosystem of openresty. Thanks. @agentzh @zhuizhuhaomeng
FYI Proposal: Hybrid programming with lua-resty-ffi This also works for openresty, except that the envoy main thread is replaced by the nginx main thread.
Some thoughts on contributing lua-resty-ffi to openresty.
lua-resty-ffi consists of 4 parts:
- a small nginx patch, commit this file to openresty repo?
- ngx_http_lua_ffi.c, commit this file to lua-nginx-module repo?
- resty_ffi.lua, commit this file to lua-resty-core repo?
- loaders for Java, Python, and Nodejs.
As said before, I really hope lua-resty-ffi can be merged into openresty. @agentzh @zhuizhuhaomeng Please revise and make suggestions, thank you.