lua-resty-redis
lua-resty-redis copied to clipboard
Async save to remote redis instances
Hello!
I have installed ngx-lua and lua-redis modules on my Linux-server. So the new site's data saved into local Redis DB via Lua code at location section of my nginx. (As I understand in non-blocking mode for other www-clients of my site). But I have some other remote Redis-servers. And I want to save the same data not only into local Redis, but to these remote Redis instances. As I understand if I do that in one Lua-code (local save+remote saves) the www-user need to wait until all save operations have be done. But I want realize remote savings as asynchronous operations. In this case www-user need to wait only local saving to local Redis. Is there any methods in lua-resty API to realize async execution of some lua-code?
please read ngx-lua-module documentation for ngx.timer.at for example this is one way to do it
@bjoe2k4: Good idea! Thank you!