-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use websocket client to sync data in local redis before nginx is accessible #63
Comments
sync data in the priviledge process, drop the request before the sync is completed. |
Hello @zhuizhuhaomeng , Im not sure to understand. openresty is quite new for me could you please be a bit more specific ? Thanks |
@matth-c3
|
Hello @doujiang24 , No, I would like to use the lua-resty-websocket client to establish a persistant connection to a remote server, before openresty/nginx is resdy to accept connections. I would do that in the init_* block but its not possible with lua-resty-{weboscket / redis }. |
okay, you can create a zero delay timer in init_worker_by_lua, like
you can do anything in the but just be noticed that the timer runs asynchronous, it won't stop openresty to accept connections. |
Hello,
Im not sure if that's possible but before I look at openresty / LUA scripting, within my microservice (nodejs), I had a websocket client that was connecting to a remote server to sync up data into redis before the service was accessible.
Those data are relative to the authentication of the users, routes, certificates and should be available before the service is up.
Can I do the same thing directly on nginx level using LUA ( and lua-resty-weboscket / lua-resty-redis ) ? As websocket and redis are not usuable in the init_* block, Im wondering how I could proceed.
Thanks
The text was updated successfully, but these errors were encountered: