Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added loop to the listen method #10

Merged
merged 2 commits into from
Nov 13, 2024
Merged

Conversation

aleksei-okatiev
Copy link
Contributor

The problem:

The RedisStream::Subscriber.listen method is called in a loop for all our services which leads to creating consumer groups for every iteration in a loop. This leads to a massive overhead to the redis instance:
image

The solution:

Move loop inside listen method and remove all loops from all our services.
Before:

loop do
  RedisStream::Subscriber.listen(streams: subscribed_to_streams) do |stream, message_id, message_name, payload|
    ....
  end
end

After:

RedisStream::Subscriber.listen(streams: subscribed_to_streams) do |stream, message_id, message_name, payload|
  ....
end

@aleksei-okatiev aleksei-okatiev merged commit f0ed519 into main Nov 13, 2024
1 check passed
@aleksei-okatiev aleksei-okatiev deleted the correct_listen_loop branch November 13, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants