totoro 0.5.7 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/totoro/base_queue.rb +4 -1
- data/lib/totoro/base_worker.rb +2 -2
- data/lib/totoro/version.rb +1 -1
- data/test/totoro_test/Gemfile.lock +3 -3
- metadata +1 -2
- data/pkg/totoro-0.5.6.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85630904511993ae3171f7e70b5c8fdec2f973c9ba79de099bd9b2ff897def24
|
4
|
+
data.tar.gz: a3d79f5cc3a21c193c0e14acc119d971f2dbcc20e2e0cd7044c716f067edf16d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc738f3bf93be2be9d7030668c48dec8f7b43f3230cc7c4cfac5803cfeb357b4cefe81fe22da9391cce9f07e0c99511707f05b63cfc3303173a3df9f8c86e943
|
7
|
+
data.tar.gz: 1d7a10ef164c84bc2b69165e52fdfd0b59a1e319e73e2fc4dcf804559d7d437949bff4bab6240f4c5c842b2d25c2fce097fd24a749e431ab9922d2f2476e3e13
|
data/lib/totoro/base_queue.rb
CHANGED
@@ -17,6 +17,10 @@ module Totoro
|
|
17
17
|
@channel ||= connection.create_channel
|
18
18
|
end
|
19
19
|
|
20
|
+
def subscribe_channel
|
21
|
+
@subscribe_channel ||= Bunny.new(config.connect).tap(&:start).create_channel
|
22
|
+
end
|
23
|
+
|
20
24
|
def exchange
|
21
25
|
@exchange ||= channel.default_exchange
|
22
26
|
end
|
@@ -35,7 +39,6 @@ module Totoro
|
|
35
39
|
end
|
36
40
|
|
37
41
|
def subscribe(id)
|
38
|
-
subscribe_channel = Bunny.new(config.connect).tap(&:start).create_channel
|
39
42
|
queue = subscribe_channel.queue(*config.queue(id))
|
40
43
|
queue.subscribe do |delivery_info, metadata, payload|
|
41
44
|
yield(delivery_info, metadata, payload)
|
data/lib/totoro/base_worker.rb
CHANGED
@@ -26,10 +26,10 @@ module Totoro
|
|
26
26
|
end
|
27
27
|
Rails.logger.info 'Listening to the Rabbitmq'
|
28
28
|
STDOUT.flush
|
29
|
-
@queue_class.
|
29
|
+
@queue_class.subscribe_channel.work_pool.join
|
30
30
|
rescue SignalException
|
31
31
|
puts 'Terminating process ..'
|
32
|
-
@queue_class.
|
32
|
+
@queue_class.subscribe_channel.work_pool.shutdown(true)
|
33
33
|
puts 'Stopped.'
|
34
34
|
end
|
35
35
|
|
data/lib/totoro/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /totoro
|
3
3
|
specs:
|
4
|
-
totoro (0.5.
|
4
|
+
totoro (0.5.7)
|
5
5
|
bunny (~> 2.10)
|
6
6
|
delayed_job_active_record (~> 4.1.3)
|
7
7
|
delayed_job_recurring (~> 0.3.7)
|
@@ -49,8 +49,8 @@ GEM
|
|
49
49
|
amq-protocol (2.3.0)
|
50
50
|
arel (8.0.0)
|
51
51
|
builder (3.2.3)
|
52
|
-
bunny (2.
|
53
|
-
amq-protocol (~> 2.3
|
52
|
+
bunny (2.11.0)
|
53
|
+
amq-protocol (~> 2.3.0)
|
54
54
|
byebug (10.0.2)
|
55
55
|
concurrent-ruby (1.0.5)
|
56
56
|
crass (1.0.4)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: totoro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ShuHui18
|
@@ -131,7 +131,6 @@ files:
|
|
131
131
|
- lib/totoro/tasks/resend_message.rake
|
132
132
|
- lib/totoro/totoro_failed_message.rb
|
133
133
|
- lib/totoro/version.rb
|
134
|
-
- pkg/totoro-0.5.6.gem
|
135
134
|
- spec/spec_helper.rb
|
136
135
|
- spec/totoro_spec.rb
|
137
136
|
- test/totoro_test/Gemfile
|
data/pkg/totoro-0.5.6.gem
DELETED
Binary file
|