Skip to content

Commit

Permalink
Merge pull request #929 from redis/handle-empty-stream-responses
Browse files Browse the repository at this point in the history
Handle empty stream responses
  • Loading branch information
byroot committed Jun 19, 2020
2 parents 0546fe6 + 7b8ac45 commit 5071cf2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/redis.rb
Expand Up @@ -3423,7 +3423,12 @@ def method_missing(command, *args) # rubocop:disable Style/MissingRespondToMissi
end
}

EMPTY_STREAM_RESPONSE = [nil].freeze
private_constant :EMPTY_STREAM_RESPONSE

HashifyStreamEntries = lambda { |reply|
return [] if reply == EMPTY_STREAM_RESPONSE

reply.map do |entry_id, values|
[entry_id, values.each_slice(2).to_h]
end
Expand Down

0 comments on commit 5071cf2

Please sign in to comment.