From ae29d650c2f9a357727483989cb0b60439f63556 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 23 May 2023 09:49:42 +0200 Subject: [PATCH] README: clarify that pubsub connection aren't automically reconnected Fix: https://github.com/redis-rb/redis-client/issues/118 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a1b5203..f341efd 100644 --- a/README.md +++ b/README.md @@ -343,6 +343,10 @@ loop do end ``` +*Note*: pubsub connections are stateful, as such they won't ever reconnect automatically. +The caller is resonsible for reconnecting if the connection is lost and to resubscribe to +all channels. + ## Production ### Instrumentation and Middlewares @@ -439,6 +443,8 @@ redis.call("GET", "counter") # Will be retried up to 3 times. redis.call_once("INCR", "counter") # Won't be retried. ``` +**Note**: automatic reconnection doesn't apply to pubsub clients as their connection is stateful. + ### Exponential backoff Alternatively, `reconnect_attempts` accepts a list of sleep durations for implementing exponential backoff: