rafka 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rafka/consumer.rb +8 -8
- data/lib/rafka/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ae73debb337586cf11886beb47e5d66d67d27d2
|
4
|
+
data.tar.gz: 3d62f4c45b95bd07fab9b9962df6f50e1fea029a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e21831f41604c1365b4d2af812edc060fbe5dd7e836b70b9c31b301bced22cc719dfd5c0fc9dfb06a74f1fae27b2788e2aba2b4df74de248ae869175606ed18d
|
7
|
+
data.tar.gz: 4985998170015c38fdd9b89c7d619068cfded34cf4e1dca77b65756459c1be4b931bc5fea6da3bec60172d2b46aae83a3aa00e138989f3a0c92653cda31277fc
|
data/lib/rafka/consumer.rb
CHANGED
@@ -21,14 +21,6 @@ module Rafka
|
|
21
21
|
# underlying Redis client
|
22
22
|
def initialize(opts={})
|
23
23
|
@redis = Redis.new(parse_opts(opts))
|
24
|
-
|
25
|
-
# in 3.2.2 and later this is done automatically
|
26
|
-
#
|
27
|
-
# @see https://github.com/redis/redis-rb/issues/510
|
28
|
-
if Gem::Version.new(Redis::VERSION) < Gem::Version.new("3.2.2")
|
29
|
-
@redis.client.call([:client, :setname, @redis.id])
|
30
|
-
end
|
31
|
-
|
32
24
|
@topic = "topics:#{opts[:topic]}"
|
33
25
|
end
|
34
26
|
|
@@ -43,6 +35,14 @@ module Rafka
|
|
43
35
|
# @example
|
44
36
|
# consume(5) { |msg| puts "I received #{msg.value}" }
|
45
37
|
def consume(timeout=5)
|
38
|
+
# in 3.2.2 and later this is done automatically
|
39
|
+
#
|
40
|
+
# @see https://github.com/redis/redis-rb/issues/510
|
41
|
+
if !@connected && Gem::Version.new(Redis::VERSION) < Gem::Version.new("3.2.2")
|
42
|
+
@redis.client.call([:client, :setname, @redis.id])
|
43
|
+
@connected = true
|
44
|
+
end
|
45
|
+
|
46
46
|
raised = false
|
47
47
|
msg = nil
|
48
48
|
|
data/lib/rafka/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agis Anastasopoulos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|