active_publisher 1.1.0.pre0-java → 1.1.1-java

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
- SHA256:
3
- metadata.gz: eac9b9246164b2807a05678bb6d059c144993b895a11d8787f1cae6420422c68
4
- data.tar.gz: 05600a427d3ea4fbd4aa5b8a45dccf296701d38bdb2ddb764eb89fe953da5585
2
+ SHA1:
3
+ metadata.gz: 85e2e2cf795ee76cb2b8a0caa318c06b5fd6e676
4
+ data.tar.gz: bbfa3baae4f5cfa1ff25ec82c9b137e5af9c86ab
5
5
  SHA512:
6
- metadata.gz: 567d4d428873934912158c765f22d13922865535a28355c94e402fa49b132fe54fa68f91d3cf81ebca5144fae8db69a11040d45dc948017217793d023955f411
7
- data.tar.gz: 65cf2d291513125dc610fb33f07fc3cb86c199c498a3e99cf0182a465402451315fa0aa9d49b5b0f8cc76652669c5f76e782f2e51ceaf2a9affd301a3f98e131
6
+ metadata.gz: 33271a30806e11d0665f926d476fb2222b3606ae53c68515f36cfc8b84105c5b47b4db8833859396d25f691d6d1ae6d1c6c86356d5b3447c184557a504d64366
7
+ data.tar.gz: 6a40c9b2d576c9c5190141f690aea1555cb06b06ec811653fb784637125b568a1194d97baad728318862ae590dd43797f45fd1cb932b84136fdeea03dc7b3e75
@@ -0,0 +1,43 @@
1
+ module ActivePublisher
2
+ module Async
3
+ module InMemoryAdapter
4
+ ##
5
+ # This class is a wrapper around bunny and march hare channels to cache exchanges.
6
+ # Bunny does this by default, but march hare will perform a blocking wait for each
7
+ # exchange declaration.
8
+ #
9
+ class Channel
10
+ attr_reader :rabbit_channel, :topic_exchange_cache
11
+
12
+ def initialize
13
+ @topic_exchange_cache = {}
14
+ @rabbit_channel = ::ActivePublisher::Connection.connection.create_channel
15
+ end
16
+
17
+ def close
18
+ rabbit_channel.close
19
+ end
20
+
21
+ def confirm_select
22
+ rabbit_channel.confirm_select
23
+ end
24
+
25
+ def topic(exchange)
26
+ topic_exchange_cache[exchange] ||= rabbit_channel.topic(exchange)
27
+ end
28
+
29
+ def using_publisher_confirms?
30
+ rabbit_channel.using_publisher_confirms?
31
+ end
32
+
33
+ def wait_for_confirms(timeout)
34
+ if rabbit_channel.method(:wait_for_confirms).arity > 0
35
+ rabbit_channel.wait_for_confirms(timeout)
36
+ else
37
+ rabbit_channel.wait_for_confirms
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -46,7 +46,7 @@ module ActivePublisher
46
46
  end
47
47
 
48
48
  def make_channel
49
- channel = ::ActivePublisher::Connection.connection.create_channel
49
+ channel = ::ActivePublisher::Async::InMemoryAdapter::Channel.new
50
50
  channel.confirm_select if ::ActivePublisher.configuration.publisher_confirms
51
51
  channel
52
52
  end
@@ -122,11 +122,7 @@ module ActivePublisher
122
122
 
123
123
  def wait_for_confirms(channel)
124
124
  return true unless channel.using_publisher_confirms?
125
- if channel.method(:wait_for_confirms).arity > 0
126
- channel.wait_for_confirms(::ActivePublisher.configuration.publisher_confirms_timeout)
127
- else
128
- channel.wait_for_confirms
129
- end
125
+ channel.wait_for_confirms(::ActivePublisher.configuration.publisher_confirms_timeout)
130
126
  end
131
127
  end
132
128
  end
@@ -1,5 +1,6 @@
1
1
  require "active_publisher/message"
2
2
  require "active_publisher/async/in_memory_adapter/async_queue"
3
+ require "active_publisher/async/in_memory_adapter/channel"
3
4
  require "active_publisher/async/in_memory_adapter/consumer_thread"
4
5
  require "concurrent"
5
6
  require "multi_op_queue"
@@ -1,3 +1,3 @@
1
1
  module ActivePublisher
2
- VERSION = "1.1.0.pre0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.pre0
4
+ version: 1.1.1
5
5
  platform: java
6
6
  authors:
7
7
  - Brian Stien
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2018-01-02 00:00:00.000000000 Z
15
+ date: 2018-01-11 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  requirement: !ruby/object:Gem::Requirement
@@ -152,6 +152,7 @@ files:
152
152
  - lib/active_publisher/async.rb
153
153
  - lib/active_publisher/async/in_memory_adapter.rb
154
154
  - lib/active_publisher/async/in_memory_adapter/async_queue.rb
155
+ - lib/active_publisher/async/in_memory_adapter/channel.rb
155
156
  - lib/active_publisher/async/in_memory_adapter/consumer_thread.rb
156
157
  - lib/active_publisher/configuration.rb
157
158
  - lib/active_publisher/connection.rb
@@ -173,12 +174,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
174
  version: '0'
174
175
  required_rubygems_version: !ruby/object:Gem::Requirement
175
176
  requirements:
176
- - - ">"
177
+ - - ">="
177
178
  - !ruby/object:Gem::Version
178
- version: 1.3.1
179
+ version: '0'
179
180
  requirements: []
180
181
  rubyforge_project:
181
- rubygems_version: 2.6.11
182
+ rubygems_version: 2.6.13
182
183
  signing_key:
183
184
  specification_version: 4
184
185
  summary: Aims to make publishing work across MRI and jRuby painless and add some nice