redis-stream 0.4.8 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/redis/stream/client.rb +8 -5
- data/lib/redis/stream/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77216cc7a26260a9b4aab0a4a12e0c6c72b5ed409bbf39dc640bfbe1d4909e78
|
4
|
+
data.tar.gz: 5e95543bdc6422e4a6aadc4d2bf814b39b46446711930cea4fab603ea36ddbda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55cc349e860a84d70faa65d4c07de1ab026fe32551fdeff0b2dfa1569396a03f0848657621e712746da9389030e683a0b4e2af8fd96ed075d016c863933d7d4e
|
7
|
+
data.tar.gz: ae445e58d4f25cfed485ff8e7b93716e1813b0df92b5d709e81d6fb596626422a8d4d60e5acd3cf1f4001834894b3cf64c7f2ddfba02f9f8847f0dacc89a88d9
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
redis-stream (0.4.
|
4
|
+
redis-stream (0.4.8)
|
5
5
|
connection_pool (~> 2.2)
|
6
6
|
moneta (~> 1.2)
|
7
7
|
multi_json (~> 1.14)
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
connection_pool (2.2.2)
|
15
15
|
json (2.3.0)
|
16
16
|
minitest (5.13.0)
|
17
|
-
moneta (1.
|
17
|
+
moneta (1.3.0)
|
18
18
|
multi_json (1.14.1)
|
19
19
|
opentracing (0.5.0)
|
20
20
|
rake (13.0.1)
|
data/lib/redis/stream/client.rb
CHANGED
@@ -317,6 +317,7 @@ class Redis
|
|
317
317
|
result = redis.xread(@stream, @lastid, block: 1000, count: 1) if @group.nil?
|
318
318
|
result = redis.xreadgroup(@group, @consumer_id, @stream, '>', block: 1000, count: 1) if @group
|
319
319
|
end
|
320
|
+
|
320
321
|
unless result.empty?
|
321
322
|
id, data_out = result[@stream][0]
|
322
323
|
ack_count = 0
|
@@ -340,11 +341,13 @@ class Redis
|
|
340
341
|
return false
|
341
342
|
end
|
342
343
|
|
343
|
-
unless
|
344
|
-
|
345
|
-
|
344
|
+
unless passthrough
|
345
|
+
unless (data_out["to"].nil? || data_out["to"].eql?('') || data_out["to"].eql?('*') || data_out["to"].eql?(@consumer_id)) &&
|
346
|
+
(data_out["to_group"].nil? || data_out["to_group"].eql?('') || data_out["to_group"].eql?('*') || data_out["to_group"].eql?(@group))
|
347
|
+
@logger.info("#{@consumer_id} - ignoring message from '#{data_out["from"]}' to '#{data_out["to"]}-#{data_out["to_group"]}'")
|
346
348
|
|
347
|
-
|
349
|
+
return false
|
350
|
+
end
|
348
351
|
end
|
349
352
|
|
350
353
|
@logger.info("#{@consumer_id} - received from '#{data_out["from"]}' of type '#{data_out['type']}' to '#{data_out["to"]}' in group '#{data_out["to_group"]}' with message id '#{id}' - with ack #{ack_count}")
|
@@ -355,7 +358,7 @@ class Redis
|
|
355
358
|
end
|
356
359
|
|
357
360
|
if data_out["type"].eql?(Redis::Stream::Type::PONG)
|
358
|
-
return
|
361
|
+
return true
|
359
362
|
end
|
360
363
|
|
361
364
|
return data_out unless async
|
data/lib/redis/stream/version.rb
CHANGED