combi 0.0.17 → 0.0.18
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/lib/combi/queue_service.rb +20 -5
- data/lib/combi/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: 3f249183796133308bcbd8d0b68d616e41843122
|
|
4
|
+
data.tar.gz: 74965fb85fa0badc9c3a105d150b9c9b83d7dd34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b99e6f2263b681f20f03b62054447258ec5b2fe99b514c7ec77e13f4160b7b2f6ffdcdd7e28d9a0e5a7f07681e4ca89bb63179fdb8ca4e8270260cf902ec8e8a
|
|
7
|
+
data.tar.gz: c9f21c5147d3afce3afb141e62d70f0c70b3d97498364abcc0719323bcf1a8160dc6a24a21eb8f753d2c6f57c1f4de3bad6666300bb0259f146ffe35e9813d99
|
data/lib/combi/queue_service.rb
CHANGED
|
@@ -23,6 +23,10 @@ module Combi
|
|
|
23
23
|
@ready_defer.callback &block
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
def status
|
|
27
|
+
@amqp_conn && @amqp_conn.status
|
|
28
|
+
end
|
|
29
|
+
|
|
26
30
|
def log(message)
|
|
27
31
|
return unless @debug_mode ||= ENV['DEBUG'] == 'true'
|
|
28
32
|
puts "#{Time.now.to_f} #{self.class.name} #{message}"
|
|
@@ -49,17 +53,28 @@ module Combi
|
|
|
49
53
|
@channel.auto_recovery = true
|
|
50
54
|
@exchange = @channel.direct ''
|
|
51
55
|
after_connect.call
|
|
56
|
+
connection.on_error do |conn, connection_close|
|
|
57
|
+
puts "[amqp connection.close] Reply code = #{connection_close.reply_code}, reply text = #{connection_close.reply_text}"
|
|
58
|
+
if connection_close.reply_code == 320
|
|
59
|
+
puts "[amqp connection.close] Setting up a periodic reconnection timer..."
|
|
60
|
+
reconnect
|
|
61
|
+
end
|
|
62
|
+
end
|
|
52
63
|
connection.on_tcp_connection_loss do |conn, settings|
|
|
53
64
|
puts "[ERROR] Connection failed, resetting for reconnect"
|
|
54
|
-
|
|
55
|
-
@ready_callbacks.each do |callback|
|
|
56
|
-
@ready_defer.callback &callback
|
|
57
|
-
end
|
|
58
|
-
start
|
|
65
|
+
reconnect
|
|
59
66
|
end
|
|
60
67
|
end
|
|
61
68
|
end
|
|
62
69
|
|
|
70
|
+
def reconnect
|
|
71
|
+
@ready_defer = EventMachine::DefaultDeferrable.new
|
|
72
|
+
@ready_callbacks.each do |callback|
|
|
73
|
+
@ready_defer.callback &callback
|
|
74
|
+
end
|
|
75
|
+
start
|
|
76
|
+
end
|
|
77
|
+
|
|
63
78
|
def disconnect
|
|
64
79
|
@amqp_conn.close
|
|
65
80
|
end
|
data/lib/combi/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: combi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- German Del Zotto
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-06-
|
|
12
|
+
date: 2014-06-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: yajl-ruby
|