amqp_helpers 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/amqp_helpers.gemspec +1 -1
- data/lib/amqp_helpers/daemon.rb +6 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/amqp_helpers.gemspec
CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.version = File.read(File.expand_path('../VERSION', __FILE__)).strip
|
4
4
|
s.authors = ['Nils Caspar', 'Raffael Schmid', 'Samuel Sieg']
|
5
5
|
s.email = 'development@nine.ch'
|
6
|
-
s.homepage = '
|
6
|
+
s.homepage = 'https://github.com/ninech/amqp_helpers'
|
7
7
|
s.license = 'MIT'
|
8
8
|
s.summary = 'Simple helpers to achieve various AMQP tasks.'
|
9
9
|
s.description = s.summary
|
data/lib/amqp_helpers/daemon.rb
CHANGED
@@ -30,6 +30,7 @@ module AMQPHelpers
|
|
30
30
|
connection.on_error(&method(:handle_connection_error))
|
31
31
|
channel = initialize_channel(connection)
|
32
32
|
connection.on_tcp_connection_loss(&method(:handle_tcp_connection_loss))
|
33
|
+
connection.on_recovery(&method(:handle_recovery))
|
33
34
|
|
34
35
|
queue = initialize_queue(channel)
|
35
36
|
queue.subscribe(&handler)
|
@@ -88,6 +89,10 @@ module AMQPHelpers
|
|
88
89
|
connection.reconnect(false, 10)
|
89
90
|
end
|
90
91
|
|
92
|
+
def handle_recovery(connection, settings)
|
93
|
+
logger.info 'Yay, reconnected! All systems go!'
|
94
|
+
end
|
95
|
+
|
91
96
|
def initialize_channel(connection)
|
92
97
|
channel = AMQP::Channel.new(connection)
|
93
98
|
channel.auto_recovery = true
|
@@ -104,5 +109,6 @@ module AMQPHelpers
|
|
104
109
|
end
|
105
110
|
end
|
106
111
|
end
|
112
|
+
|
107
113
|
end
|
108
114
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amqp_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -97,7 +97,7 @@ files:
|
|
97
97
|
- lib/amqp_helpers/daemon.rb
|
98
98
|
- spec/daemon_spec.rb
|
99
99
|
- spec/spec_helper.rb
|
100
|
-
homepage:
|
100
|
+
homepage: https://github.com/ninech/amqp_helpers
|
101
101
|
licenses:
|
102
102
|
- MIT
|
103
103
|
post_install_message:
|