action_subscriber 5.1.2 → 5.1.3.pre1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b6dd62b9d5f71b0f161b71a7cf59a485178d9fe2056ae79554b9bdad48b61e9
4
- data.tar.gz: 6bdb8e90b287c2d14ff429e34b7c6892fe19544f1625a1f7df80de4e7a0dbb09
3
+ metadata.gz: fa5bf15c517485c9cccb0106e54b710a9ea27f531206b7f631c90b034214b45e
4
+ data.tar.gz: e1c884f440fa8fef25b63f04fa574e458ff60a2a0887b6fc2b1e44f96fb973e7
5
5
  SHA512:
6
- metadata.gz: 7cb13e80ea9341fa93ce77474463fde461b962065a65e1d7c9789b1e99cbe87ab2719139de583f51445f8ab4894406b29e5993e9042f2f93239b47f29fb00206
7
- data.tar.gz: 95227585a26ffdccae8785deeb6579eff286c6ea782c5ee83934c7049355a99d2a722054866eba173e514292b01c92a57e7ab80aab4c12e9f13190c559d8cf6b
6
+ metadata.gz: 8eff6bc852dbdbc1d96e0ef6894b8329a015542b7bb8764fba11d46c279c380c9eacf610de3e24a8729b38e8b8dba42b8d339eefad9f12dd5fad356596661dc6
7
+ data.tar.gz: 244a5f01766f1c3428a36a8f5cac737d4545d71f9202b92183ea7ccf39fac87cfdaea4499f9e59ef979f7627025402ded93885d015b82387226852104f1c3741
@@ -46,16 +46,25 @@ module ActionSubscriber
46
46
  end
47
47
 
48
48
  def self.with_exchange(env, ttl, retry_queue_name)
49
- channel = RabbitConnection.with_connection{|connection| connection.create_channel}
50
- begin
49
+ unless env.channel.open?
50
+ begin
51
+ channel = RabbitConnection.with_connection{|connection| connection.create_channel}
52
+ channel.confirm_select
53
+ # an empty string is the default exchange [see bunny docs](http://rubybunny.info/articles/exchanges.html#default_exchange)
54
+ exchange = channel.topic("")
55
+ queue = channel.queue(retry_queue_name, :arguments => {"x-dead-letter-exchange" => "", "x-message-ttl" => ttl, "x-dead-letter-routing-key" => env.queue})
56
+ yield(exchange)
57
+ channel.wait_for_confirms
58
+ ensure
59
+ channel.close rescue nil
60
+ end
61
+ else
51
62
  channel.confirm_select
52
63
  # an empty string is the default exchange [see bunny docs](http://rubybunny.info/articles/exchanges.html#default_exchange)
53
64
  exchange = channel.topic("")
54
65
  queue = channel.queue(retry_queue_name, :arguments => {"x-dead-letter-exchange" => "", "x-message-ttl" => ttl, "x-dead-letter-routing-key" => env.queue})
55
66
  yield(exchange)
56
67
  channel.wait_for_confirms
57
- ensure
58
- channel.close rescue nil
59
68
  end
60
69
  end
61
70
  end
@@ -6,6 +6,7 @@ module ActionSubscriber
6
6
  attr_accessor :payload
7
7
 
8
8
  attr_reader :action,
9
+ :channel,
9
10
  :content_type,
10
11
  :encoded_payload,
11
12
  :exchange,
@@ -1,3 +1,3 @@
1
1
  module ActionSubscriber
2
- VERSION = "5.1.2"
2
+ VERSION = "5.1.3.pre1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_subscriber
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.1.3.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Stien
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2018-07-26 00:00:00.000000000 Z
15
+ date: 2018-11-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
@@ -292,12 +292,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
292
292
  version: '0'
293
293
  required_rubygems_version: !ruby/object:Gem::Requirement
294
294
  requirements:
295
- - - ">="
295
+ - - ">"
296
296
  - !ruby/object:Gem::Version
297
- version: '0'
297
+ version: 1.3.1
298
298
  requirements: []
299
299
  rubyforge_project:
300
- rubygems_version: 2.7.6
300
+ rubygems_version: 2.7.7
301
301
  signing_key:
302
302
  specification_version: 4
303
303
  summary: ActionSubscriber is a DSL that allows a rails app to consume messages from