lua-nginx-module
lua-nginx-module copied to clipboard
Allow cosockets, light threads, semaphores and etc in the context of init_by_lua*
It is desired to enable those Lua APIs that might yield in the context of init_by_lua*. It's particularly useful to have the ability to initiate multiple concurrent light threads to (pre)load crucial metadata from some remote services upon startup.
Under the hood, we can simply plant an event loop in the init_by_lua* handler with a configurable timeout protection (to avoid the server from taking too long to start).
It's very interesting. Are these any guy to implement this Or It's welcome to initiate a PR :-)
@detailyang yeah, I'm working for it, but PR welcome also :)
@doujiang24 You are awesome :) what's you branch name of https://github.com/doujiang24/lua-nginx-module and I'm willing to follow you to learn :smile:
@detailyang No branch yet, will show you when I have one :)
This would be awesome. I'd be very interested in trying whatever work in progress.
+1 Hey, i'm also interested to create a light thread in init_by_lua* to use resty.redis for read locations from a redis table. This location-entities are used to generated location-files and dynamically reload the nginx.
The current workaround is to create a light thread in init_worker_by_lua* with the ngx.worker.id equals zero and to the location retrieving there.
any plans to get this done soon?
Guys, patches welcome :)
伙计们,欢迎补丁:)
any plans to get this done soon?
Hello @agentzh ,
Any update on this ?
Thanks
ping @doujiang24 @zhuizhuhaomeng
and here is the progress so far https://github.com/openresty/lua-nginx-module/pull/1825
Hello @agentzh, Please review this pr #1825
Thanks