docs(api): add a short note about the target_node argument

This commit is contained in:
QuantumGhost
2026-02-06 14:42:04 +08:00
parent 79b6117d80
commit b893d2df82

View File

@ -70,6 +70,10 @@ class _RedisShardedSubscription(RedisSubscriptionBase):
# Since we have already filtered at the caller's site, we can safely set
# `ignore_subscribe_messages=False`.
if isinstance(self._client, RedisCluster):
# NOTE(QuantumGhost): due to an issue in upstream code, calling `get_sharded_message`
# would use busy-looping to wait for incoming message, consuming excessive CPU quota.
#
# Here we specify the `target_node` to mitigate this problem.
node = self._client.get_node_from_key(self._topic)
return self._pubsub.get_sharded_message(
ignore_subscribe_messages=False,