openresty / lua-nginx-module

Embed the Power of Lua into NGINX HTTP servers
https://openresty.org/
11.35k stars 2.04k forks source link

Proposal: Hybrid programming with lua-resty-ffi #2135

Open kingluo opened 1 year ago

kingluo commented 1 year ago

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:

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

Chinese blog

I hope I could merge this library into openresty. It's meaningful to extend the ecosystem of openresty. Thanks. @agentzh @zhuizhuhaomeng

kingluo commented 8 months ago

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.

kingluo commented 8 months ago

Some thoughts on contributing lua-resty-ffi to openresty.

lua-resty-ffi consists of 4 parts:

  1. a small nginx patch, commit this file to openresty repo?
  2. ngx_http_lua_ffi.c, commit this file to lua-nginx-module repo?
  3. resty_ffi.lua, commit this file to lua-resty-core repo?
  4. 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.