Open guowseu opened 11 years ago
Well, just try connecting to the redis server via ngx_lua's TCP/stream cosocket API:
http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp
Basically, you just need to connect to the server and check the return values (if it is connected, remember closing it or putting it into the connection pool, depending on your needs). Also ensure that you call the settimeout method to set a small enough timeout before calling the connect method.
If you want to know if some kind of data has been pushed to server, you can just use the Redis pub/sub API: http://redis.io/topics/pubsub (for long polling) or do timed short polling, depending on your requirements.
Hi,
Now I want to implement the following function, I want to tell our clients if the data pushed to the redis so that clients can delete local cache. So I want to know if the redis server is ready to accepts requests.
And how to implement this?
Thanks