message-driver 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/features/CHANGELOG.md +7 -0
- data/lib/message_driver/adapters/bunny_adapter.rb +25 -1
- data/lib/message_driver/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: 2f5ef960a3a18031fa4f37ed941eae929da2237d
|
4
|
+
data.tar.gz: 699dee982c1d805fde348b8af5354df212cabc03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 362dffea89638f6366ecf26e673c510aa40981e77f590470e377d51b87e07271caa151bcc8d04b948e1dbe7d1a9268b7cba57fa646328645e8ab58b318ea31cc
|
7
|
+
data.tar.gz: b044a83acfc3be5a1a6760eb1543cca63f6cf4b08f07a9a3a0e697bdd152e1aa546580a628351986fcbc2156c6c1d2724d101632c18366cecefd6b85750e80e1
|
data/CHANGELOG.md
CHANGED
data/features/CHANGELOG.md
CHANGED
@@ -183,10 +183,11 @@ module MessageDriver
|
|
183
183
|
def initialize(config)
|
184
184
|
validate_bunny_version
|
185
185
|
@config = config
|
186
|
+
start_connection_thread
|
186
187
|
end
|
187
188
|
|
188
189
|
def connection(ensure_started=true)
|
189
|
-
|
190
|
+
start_connection_thread
|
190
191
|
if ensure_started && !@connection.open?
|
191
192
|
begin
|
192
193
|
@connection.start
|
@@ -398,6 +399,29 @@ module MessageDriver
|
|
398
399
|
|
399
400
|
private
|
400
401
|
|
402
|
+
def start_connection_thread
|
403
|
+
@connection_thread ||= Thread.new do
|
404
|
+
begin
|
405
|
+
@connection = Bunny.new(@config)
|
406
|
+
sleep
|
407
|
+
rescue *NETWORK_ERRORS => e
|
408
|
+
logger.error "error on connection\n#{exception_to_str(e)}"
|
409
|
+
begin
|
410
|
+
while true
|
411
|
+
@connection.start
|
412
|
+
sleep
|
413
|
+
end
|
414
|
+
rescue *NETWORK_ERRORS => e
|
415
|
+
logger.error "error trying to restart connection\n#{exception_to_str(e)}"
|
416
|
+
sleep 1
|
417
|
+
retry
|
418
|
+
end
|
419
|
+
end
|
420
|
+
@connection_thread = nil
|
421
|
+
end
|
422
|
+
sleep 0.1 while @connection_thread.status != 'sleep'
|
423
|
+
end
|
424
|
+
|
401
425
|
def validate_bunny_version
|
402
426
|
required = Gem::Requirement.create('>= 0.10.8')
|
403
427
|
current = Gem::Version.create(Bunny::VERSION)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: message-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|