rabbit_jobs 0.11.4 → 0.11.5

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
  SHA1:
3
- metadata.gz: dff8d6171cd4174eef097c45b1882db5c00721fc
4
- data.tar.gz: 38e0f6d1d73e3be81445ff5dec95c79155a07e43
3
+ metadata.gz: bbaa1fdb2d8e1c9716955755efa130be1eee820e
4
+ data.tar.gz: f2b6a65de1baff5a6b4696344ac4fe8d7bc5472c
5
5
  SHA512:
6
- metadata.gz: 5054d1af4332fc96218d42b2c8fadc3b06286c688c76e9ce2af88f42c0d2a43a901c235105afaa7ca895a8fe22064b4ef261823ae51ee452ec64d47d4226de97
7
- data.tar.gz: 7caadfdde460a34dd0004adf5cbce2658c7c94a49b1c397fc04212304b24c3a9a6985603a80ad46d71cd866074aff436fdcc3ce6acb324b65086b74e268225f2
6
+ metadata.gz: 0cd1995fc29516e21c31b0cdd5993e0184f06b25eef129d095e39cd83298c89d57206d795023ae21e22c817f947877a9cdedd075ab207e93062b29e99af47924
7
+ data.tar.gz: dd3ebbf992e689b3afabb00803b7159b89bb9088071b757c38ea3d4174478601ba234c7f2ee440d438768754f990312964cc1dd58242f026b068d82b9c570e63
@@ -21,7 +21,10 @@ module RabbitJobs
21
21
 
22
22
  if @shutdown
23
23
  RabbitJobs.logger.info "Stopping."
24
- amqp_connection.stop if defined?(amqp_connection) # in worker only
24
+ if defined?(amqp_connection) # in worker only
25
+ amqp_connection.stop
26
+ amqp_channel.work_pool.join
27
+ end
25
28
  yield if block_given?
26
29
  return true
27
30
  end
@@ -38,4 +41,4 @@ module RabbitJobs
38
41
  end
39
42
  end
40
43
  end
41
- end
44
+ end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module RabbitJobs
4
- VERSION = "0.11.4"
4
+ VERSION = "0.11.5"
5
5
  end
@@ -17,6 +17,10 @@ module RabbitJobs
17
17
  properties: Bunny::Session::DEFAULT_CLIENT_PROPERTIES.merge(product: "rj_worker #{Process.pid}")).start
18
18
  end
19
19
 
20
+ def amqp_channel
21
+ @amqp_channel ||= amqp_connection.create_channel
22
+ end
23
+
20
24
  def self.cleanup
21
25
  conn = Thread.current[:rj_worker_connection]
22
26
  conn.close if conn && conn.status != :not_connected
@@ -60,11 +64,10 @@ module RabbitJobs
60
64
  @processed_count = 0
61
65
 
62
66
  begin
63
- amqp_channel = amqp_connection.create_channel
64
67
  amqp_channel.prefetch(1)
65
68
 
66
69
  queues.each do |routing_key|
67
- consume_queue(amqp_channel, routing_key)
70
+ consume_queue(routing_key)
68
71
  end
69
72
 
70
73
  RJ.logger.info "Started."
@@ -110,7 +113,7 @@ module RabbitJobs
110
113
  end
111
114
  end
112
115
 
113
- def consume_queue(amqp_channel, routing_key)
116
+ def consume_queue(routing_key)
114
117
  RJ.logger.info "Subscribing to #{routing_key}"
115
118
  routing_key = routing_key.to_sym
116
119
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbit_jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Lazureykis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-27 00:00:00.000000000 Z
11
+ date: 2014-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  requirements: []
206
206
  rubyforge_project:
207
- rubygems_version: 2.0.14
207
+ rubygems_version: 2.0.0
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: Background jobs on RabbitMQ