Support Cluster PubSub in asyncio#3736
Conversation
|
Hi @abersheeran, thank you for your contribution! We will review your changes soon. |
|
+1 |
ebb3e59 to
35d93fc
Compare
89fd29d to
4b07f82
Compare
…cal access only, no fix available
…node mapping is empty
85e806e to
6cec200
Compare
|
Hey @petyaslavova, I'm interested in using this to add support for Redis clusters to faststream (see issue) I have seen that this is has been added to release 8.0.0b1 I have also seen that 8.0.0b2 is bringing a variety of breaking changes. Is there any chance that async cluster pubsub could be included as a minor release for |
|
Hey @abersheeran, the biggest changes that were breaking in 8.0.0b2 - the ones related to command responses are reverted and 8.0.0 will be released without all those changed results object format changes. You can check the finilized changes related to protocol update in PR #4052 |

Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Support Cluster PubSub in asyncio
Note
Medium Risk
Adds new asyncio cluster pub/sub implementation with per-node routing and connection pool management; behavior changes around sharded subscribe/message filtering could impact pubsub consumers if edge cases exist.
Overview
Adds asyncio Redis Cluster pub/sub support via a new
ClusterPubSuband aRedisCluster.pubsub()factory that can bind to a specific node (byClusterNodeorhost/port) or lazily select one.Extends asyncio
PubSubto track shard channels (SSUBSCRIBE/SUNSUBSCRIBE), resubscribe them on reconnect, treatsmessageas a publish event (including observability recording), and include shard subscriptions in thesubscribedstate.Updates cluster command mixins so asyncio cluster clients include
PubSubCommands, tightens sharded message filtering/round-robin generator behavior (avoids infinite loop when no node pubsubs exist), adds extensive asyncio cluster pubsub tests, and tweaks CI dependency-audit to ignore one additional CVE.Written by Cursor Bugbot for commit 6371eb5. This will update automatically on new commits. Configure here.