rabid_mq 0.1.36 → 0.1.37

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: 60a529e7dee912940f223740162d45767a53f765
4
- data.tar.gz: 7097749742e8805903bce0a94b1272bf1f5c64c6
3
+ metadata.gz: 91618ae8f87b17e3a41de52a57e8d909c30e22a7
4
+ data.tar.gz: e192092ead5a109c2caeb1f886a3845738a57b13
5
5
  SHA512:
6
- metadata.gz: a4308b5d1918dc730e499ec1f4efb7a80c68f6df7958a53565c50e7aac89e97ba7392e0d9ba00de9a42375e0f5f98eac042143bf2bf196f086eea9642e474b3b
7
- data.tar.gz: 4be16cafabcd10e23addc95ad062d02f5162bd0901f57569ec615fa071f08d9ec8eef68e1b355ce7fe8bdb245f7186b51b185db6b60a72f6d87ff0d9aa84c1aa
6
+ metadata.gz: 7b90d948ca3cb490199709b2b2d09bf6409bf982271a3f982994757a258613815a2b5da00177510d7b4c38c051d1fd1cee98641aaa069dd6d4fdc5b096d0a38d
7
+ data.tar.gz: 27d99fe75fe1aaece4123065e321b48317eb254e180b4b84e61b3d5ade2ce2c4d50262ccb9304711b808936d6f55d32b55ac83520ae2442a31e7cb223fb8cd4d
@@ -44,7 +44,7 @@ module RabidMQ
44
44
 
45
45
  # Provide a topic exchange on demand connected to the existing channel
46
46
  def topic_exchange(topic, **options)
47
- channel.topic(name_with_env(topic), **options)
47
+ channel.topic(name_with_env(topic) **options)
48
48
  end
49
49
 
50
50
  # Provide fanout exchange
@@ -52,10 +52,17 @@ module RabidMQ
52
52
  channel.fanout(name_with_env(topic), **options)
53
53
  end
54
54
 
55
- # Get a channel with the Bunny::Session
56
- delegate :channel,
57
- :reconnect,
58
- to: ::RabidMQ
55
+ def channel
56
+ return @channel if @channel && !@channel.closed?
57
+ @channel = amqp_connect.create_channel
58
+ rescue Bunny::ChannelAlreadyClosed => e
59
+ reconnect
60
+ end
61
+
62
+ def reconnect
63
+ @channel = nil
64
+ channel
65
+ end
59
66
 
60
67
  # Start a new connection
61
68
  def amqp_connect
@@ -1,3 +1,3 @@
1
1
  module RabidMQ
2
- VERSION = "0.1.36"
2
+ VERSION = "0.1.37"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabid_mq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.36
4
+ version: 0.1.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyrone Wilson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2018-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny