Skip to content

Commit 5a6f5fb

Browse files
authored
fix: balancing act for subscription (#224)
1 parent bf24bc2 commit 5a6f5fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/redis_client/cluster/pub_sub.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def next_event(timeout = nil)
6565
loop do
6666
break if max_duration > 0 && obtain_current_time - starting > max_duration
6767

68-
@states.each_value do |pubsub|
68+
@states.values.shuffle.each do |pubsub|
6969
message = pubsub.take_message(timeout)
7070
return message if message
7171
end

0 commit comments

Comments
 (0)