rafka 0.0.7 → 0.0.8

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: 4b373f61cafd171166bb214fca2e36d3f7e36c40
4
- data.tar.gz: 3baee498081c2aabfd195074cdb2695ad5b4711a
3
+ metadata.gz: d22b37dbbd835861eab2d1de45be8194ef0d0378
4
+ data.tar.gz: c2356e4e9e1014a6139e151808559b09fe72081b
5
5
  SHA512:
6
- metadata.gz: caa3b522f9fc732d72be3aeba84c891223545651c41a8b61a4144ddbb0f5fcbac0673b8c17460358cb058cee21130df1f8819a70e3fb99c6e04461cb1ee2bcd7
7
- data.tar.gz: 38c9e593ded9496547dbdf4b3445dbd7b622b3a232ae7c833fb7d0689dc9625b15b857f45e9c2d1ca246ed5a3086ee0cbfa46463794a9f61889cba9fd24de4d2
6
+ metadata.gz: b30363423f40411dc406e1f2b27d730780c4ffacc9bc971b2ba063449fed15e2d7f68bd4b9ceeafd18c61c608c3b2100015d4b71ceee1cf279cdd939fc57f3f4
7
+ data.tar.gz: 5b44cf07218a2d7041a49b4328f57111e415f802da9dbcdaad1dccbc5d3ab909482abe323ff113506f0065a166a03cdf3d5af204a1cf0cea92e2c19ddf92abfc
@@ -20,7 +20,8 @@ module Rafka
20
20
  # @option opts [Hash] :redis ({}) Optional configuration for the
21
21
  # underlying Redis client
22
22
  def initialize(opts={})
23
- @redis = Redis.new(parse_opts(opts))
23
+ @options = parse_opts(opts)
24
+ @redis = Redis.new(@options)
24
25
  @topic = "topics:#{opts[:topic]}"
25
26
  end
26
27
 
@@ -51,7 +52,7 @@ module Rafka
51
52
 
52
53
  begin
53
54
  Rafka.wrap_errors do
54
- Rafka.with_retry do
55
+ Rafka.with_retry(times: @options[:reconnect_attempts]) do
55
56
  msg = @redis.blpop(@topic, timeout: timeout)
56
57
  end
57
58
  end
@@ -15,7 +15,8 @@ module Rafka
15
15
  #
16
16
  # @return [Producer]
17
17
  def initialize(opts={})
18
- @redis = Redis.new(parse_opts(opts))
18
+ @options = parse_opts(opts)
19
+ @redis = Redis.new(@options)
19
20
  end
20
21
 
21
22
  # Produce a message. This is an asynchronous operation.
@@ -27,7 +28,9 @@ module Rafka
27
28
  # produce("greetings", "Hello there!")
28
29
  def produce(topic, msg)
29
30
  Rafka.wrap_errors do
30
- @redis.rpushx("topics:#{topic}", msg.to_s)
31
+ Rafka.with_retry(times: @options[:reconnect_attempts]) do
32
+ @redis.rpushx("topics:#{topic}", msg.to_s)
33
+ end
31
34
  end
32
35
  end
33
36
 
data/lib/rafka/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rafka
2
- VERSION = "0.0.7".freeze
2
+ VERSION = "0.0.8".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.7
4
+ version: 0.0.8
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-13 00:00:00.000000000 Z
11
+ date: 2017-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis