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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f961cb189ee48a2613c3265d690928fba04bb855
4
- data.tar.gz: e8e59b4f25df06d35f0f19d90f3f719ee31e7134
3
+ metadata.gz: 6ae73debb337586cf11886beb47e5d66d67d27d2
4
+ data.tar.gz: 3d62f4c45b95bd07fab9b9962df6f50e1fea029a
5
5
  SHA512:
6
- metadata.gz: be4b103e6a5436d48ace4734339e39939aecb0747a5572b8cbfde841a6eac28c9d5a0a853770037652cf937f017539124b71d3968e4235a3e583c00a3df93570
7
- data.tar.gz: 241ece58c6d52ed8ec2a1979b9cedeb73945e498ca6c05fbb1695b64e6139b62c7059c611035b2add97c160c88cb8aa487c8d521c7861202530951b80412df87
6
+ metadata.gz: e21831f41604c1365b4d2af812edc060fbe5dd7e836b70b9c31b301bced22cc719dfd5c0fc9dfb06a74f1fae27b2788e2aba2b4df74de248ae869175606ed18d
7
+ data.tar.gz: 4985998170015c38fdd9b89c7d619068cfded34cf4e1dca77b65756459c1be4b931bc5fea6da3bec60172d2b46aae83a3aa00e138989f3a0c92653cda31277fc
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Rafka
2
- VERSION = "0.0.5".freeze
2
+ VERSION = "0.0.6".freeze
3
3
  end
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.5
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 00:00:00.000000000 Z
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis