Skip to content

Commit

Permalink
README: clarify that pubsub connection aren't automically reconnected
Browse files Browse the repository at this point in the history
Fix: #118
  • Loading branch information
byroot committed May 23, 2023
1 parent 29da108 commit ae29d65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ae29d65

Please sign in to comment.