sensu-transport 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: 25757d5c1a633408ef5394569b898aa68dd87ea8
4
- data.tar.gz: 307d4db59e6d57f3dbf74cc4b44c020322821f02
3
+ metadata.gz: 2496679cd2381c318009355b8053bc5a6538b38c
4
+ data.tar.gz: 0ef31ba66257db7ca775231bcd57fcd08558cdb5
5
5
  SHA512:
6
- metadata.gz: e7364481b3b576241e4bbd2f0078e1511dc83ab29ed630defbabc3239c1a282ca10bd4cf159a019b96ec3b161e0fe00980ad23f77db451f37850c1268d4b7cc1
7
- data.tar.gz: 037e972322a334c8395cdc24f1174f936043c85e2b14567969e2eded9e9e6beebff2b2cac9c4367ab978bd33e29fc1e255df15eecda99d65f107ac0779efd73a
6
+ metadata.gz: eb087f8e880e4e756d592d801fa781b32f38f3c19fe0aaaec87933e95c97ba84d4a8e649991f72ea6d1ae4623ddb96807830b6b8e6c6107371bab01d32a4a9f6
7
+ data.tar.gz: 87a36f325889d9bdb440d301d03dcbd56d8249ecc62e9d9e91beb740ec1793204f378945c05451f7ab0029b0b3a4aee0da2823a1c5ef7f4c9d49e617494d76b2
@@ -25,9 +25,6 @@ module Sensu
25
25
  reconnect_callback = Proc.new { reconnect }
26
26
  @connection.on_tcp_connection_loss(&reconnect_callback)
27
27
  @connection.on_skipped_heartbeats(&reconnect_callback)
28
- @connection.on_recovery do
29
- @after_reconnect.call
30
- end
31
28
  setup_channel(options)
32
29
  end
33
30
 
@@ -35,7 +32,15 @@ module Sensu
35
32
  unless @connection.reconnecting?
36
33
  @connection_timeout.cancel
37
34
  @before_reconnect.call
38
- @connection.periodically_reconnect(5)
35
+ timer = EM::PeriodicTimer.new(5) do
36
+ begin
37
+ @connection.reconnect(true)
38
+ rescue EventMachine::ConnectionError
39
+ end
40
+ end
41
+ @connection.on_recovery do
42
+ timer.cancel
43
+ end
39
44
  end
40
45
  end
41
46
 
@@ -128,6 +133,9 @@ module Sensu
128
133
  prefetch = options.fetch(:prefetch, 1)
129
134
  end
130
135
  @channel.prefetch(prefetch)
136
+ @channel.on_recovery do
137
+ @after_reconnect.call
138
+ end
131
139
  end
132
140
  end
133
141
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-transport"
5
- spec.version = "0.0.5"
5
+ spec.version = "0.0.6"
6
6
  spec.authors = ["Sean Porter"]
7
7
  spec.email = ["portertech@gmail.com"]
8
8
  spec.summary = "The Sensu transport abstraction library"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-transport
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
  - Sean Porter