Skip to content

Commit

Permalink
reads messages from a stream using NOACK to prevent them from being o…
Browse files Browse the repository at this point in the history
…n the pending list (PEL) forever
  • Loading branch information
jeanmartin committed Aug 21, 2024
1 parent 6c9727d commit 56f34bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/redis_stream/subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.listen(streams:, group: nil, consumer: nil, &block)

# listen for up to 10 messages forever
ids = Array.new(streams.length, ">")
messages = RedisStream.client.xreadgroup(group, consumer, streams, ids, count: 1, block: 0)
messages = RedisStream.client.xreadgroup(group, consumer, streams, ids, count: 1, block: 0, noack: true)

messages.each do |stream, stream_messages|
stream_messages.each do |message_id, message_hash|
Expand Down
2 changes: 1 addition & 1 deletion lib/redis_stream/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RedisStream
VERSION = "0.1.3"
VERSION = "0.1.4"
end

0 comments on commit 56f34bb

Please sign in to comment.