active_publisher 1.3.0.pre0-java → 1.3.0.pre1-java

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: 8ab5bdf4352d3913b934a0e54a0085effe6fcf69
4
- data.tar.gz: 4baa705ae3174699cd4d55ecd51b907dd14ce621
3
+ metadata.gz: 0ca07238c385be8aeeca233da0dfc1d8241f65ed
4
+ data.tar.gz: 13d7d60b5fd3318348a0bcd0509c7900d47e8b12
5
5
  SHA512:
6
- metadata.gz: c47d2ae4a05f959983fe022c6aa2face66684a86b8d9bc3e923f55dcdbdcb826b75c21d1c719ad4ace2e9c3cf2ea2b3aa7d4f43a5e9afd2216399fee7359e5b8
7
- data.tar.gz: 7930ca08472a9370f6a39789a0d845b19553c0d4ebc98d31f28202182e34a5333a0fe2d5c62678e7972d25a5fc06e60ffffa64d4c2fb939362dba72ba430e89c
6
+ metadata.gz: 3a5d85a9cdf48d09fc0d49c7ee338c1f61f15c0e8034f97aa1b69202ec209e7654a5ed841644d32338b49ff28db51f4dcc6daed6b3348ff89a432ba4967ba28a
7
+ data.tar.gz: d446ff5e9022e44195a60b354a859f630c5093ef8267f4c2406939c0d6c622b34e3cbe0c5198b0b24d31b21653d7026928888315b6ed11b2ee389ccd332b2f56
@@ -9,28 +9,33 @@ module ActivePublisher
9
9
  :timeout_interval => 5, # seconds
10
10
  }
11
11
 
12
- attr_reader :consumer, :queue, :supervisor
12
+ attr_reader :consumers, :queue, :supervisor
13
13
 
14
14
  def initialize(redis_pool)
15
15
  @queue = ::ActivePublisher::Async::RedisAdapter::RedisMultiPopQueue.new(redis_pool, ::ActivePublisher::Async::RedisAdapter::REDIS_LIST_KEY)
16
- create_and_supervise_consumer!
16
+ @consumers = {}
17
+ create_and_supervise_consumers!
17
18
  end
18
19
 
19
- def create_and_supervise_consumer!
20
- @consumer = ::ActivePublisher::Async::InMemoryAdapter::ConsumerThread.new(queue)
21
-
22
- supervisor_task = ::Concurrent::TimerTask.new(SUPERVISOR_INTERVAL) do
23
- # This may also be the place to start additional publishers when we are getting backed up ... ?
24
- unless consumer.alive?
25
- consumer.kill rescue nil
26
- @consumer = ::ActivePublisher::Async::InMemoryAdapter::ConsumerThread.new(queue)
20
+ def create_and_supervise_consumers!
21
+ ::ActivePublisher.configuration.publisher_threads.times do
22
+ consumer_id = ::SecureRandom.uuid
23
+ consumers[consumer_id] = ::ActivePublisher::Async::InMemoryAdapter::ConsumerThread.new(queue)
24
+
25
+ supervisor_task = ::Concurrent::TimerTask.new(SUPERVISOR_INTERVAL) do
26
+ consumer = consumers[consumer_id]
27
+ # This may also be the place to start additional publishers when we are getting backed up ... ?
28
+ unless consumer.alive?
29
+ consumer.kill rescue nil
30
+ consumers[consumer_id] = ::ActivePublisher::Async::InMemoryAdapter::ConsumerThread.new(queue)
31
+ end
32
+
33
+ # Notify the current queue size.
34
+ ::ActiveSupport::Notifications.instrument "redis_async_queue_size.active_publisher", queue.size
27
35
  end
28
36
 
29
- # Notify the current queue size.
30
- ::ActiveSupport::Notifications.instrument "redis_async_queue_size.active_publisher", queue.size
37
+ supervisor_task.execute
31
38
  end
32
-
33
- supervisor_task.execute
34
39
  end
35
40
 
36
41
  def size
@@ -1,3 +1,3 @@
1
1
  module ActivePublisher
2
- VERSION = "1.3.0.pre0"
2
+ VERSION = "1.3.0.pre1"
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.3.0.pre0
4
+ version: 1.3.0.pre1
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-03-13 00:00:00.000000000 Z
15
+ date: 2018-03-14 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  requirement: !ruby/object:Gem::Requirement