totoro 0.5.7 → 0.6.0

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: d50c9e770a7ec4dcaf74ff7325388f23af139e5edfddb290fd4960268c6f0561
4
- data.tar.gz: ba715af8c6aefd7ee1e77d31c81720b2b4fcee5f1d0f954874da05348ea87b10
3
+ metadata.gz: 85630904511993ae3171f7e70b5c8fdec2f973c9ba79de099bd9b2ff897def24
4
+ data.tar.gz: a3d79f5cc3a21c193c0e14acc119d971f2dbcc20e2e0cd7044c716f067edf16d
5
5
  SHA512:
6
- metadata.gz: '050040108087d5fd0a56ca2d138c66d0c41b1c97cb2f2b46df5391f8c7f771e4c72be5b6e014eb29c40b14cdf67336d64b710be3a5b43e46de5084da7b333624'
7
- data.tar.gz: 63c31cbc2f61e6eec57b0d8d6b6bd8d036a2f13193860497faa52b0ba5aa4e4d44d34ddc0ffe026668c6baa70d7f039a39baeac948a7f0f445991e37e33c144e
6
+ metadata.gz: dc738f3bf93be2be9d7030668c48dec8f7b43f3230cc7c4cfac5803cfeb357b4cefe81fe22da9391cce9f07e0c99511707f05b63cfc3303173a3df9f8c86e943
7
+ data.tar.gz: 1d7a10ef164c84bc2b69165e52fdfd0b59a1e319e73e2fc4dcf804559d7d437949bff4bab6240f4c5c842b2d25c2fce097fd24a749e431ab9922d2f2476e3e13
@@ -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)
@@ -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.channel.work_pool.join
29
+ @queue_class.subscribe_channel.work_pool.join
30
30
  rescue SignalException
31
31
  puts 'Terminating process ..'
32
- @queue_class.channel.work_pool.shutdown(true)
32
+ @queue_class.subscribe_channel.work_pool.shutdown(true)
33
33
  puts 'Stopped.'
34
34
  end
35
35
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Totoro
4
- VERSION = '0.5.7'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /totoro
3
3
  specs:
4
- totoro (0.5.4)
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.12.0)
53
- amq-protocol (~> 2.3, >= 2.3.0)
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.5.7
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