msgr 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/lib/msgr/client.rb +8 -3
- data/lib/msgr/version.rb +1 -1
- data/spec/fixtures/msgr_routes_test_drain.rb +5 -0
- data/spec/unit/msgr/client_spec.rb +1 -6
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13657fc492608f204e15feb6dd99b4201ae0de4972c6251970009fecab1f4343
|
4
|
+
data.tar.gz: 99b4dbd131d80b3d1ab7b638b78af8a3ec91d43f3a18f30bc7bec073cdd1c89d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7097dd99d5ce3ebfe81763a9a49775ba8605ceca1695d6b736baa0db6057d1c94b0e7d5d1349d9c7df0783c3a26a858a2ee659766a06846bd914bc0fdd75982b
|
7
|
+
data.tar.gz: 0ddde917911e057af0c55d0adc69e26aa4d76c8086df2aea35b7d519715555a4c06544e9befd835f3d638f40dcd6fa480f3dfbdd5e74d0c04b5c230c9d68c074
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.3.2] - 2021-09-21
|
9
|
+
### Fixed
|
10
|
+
- Rake task `msgr:drain` ran before all routes were initialized (#44)
|
11
|
+
|
8
12
|
## [1.3.1] - 2020-12-16
|
9
13
|
### Fixed
|
10
14
|
- Delay setting default options for correct relative routing file path
|
@@ -12,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
12
16
|
## [1.3.0] - 2020-12-16
|
13
17
|
### Added
|
14
18
|
- Support and testing for Rails 6.1
|
15
|
-
- Rake task
|
19
|
+
- Rake task for purging all known queues (#43)
|
16
20
|
|
17
21
|
### Changed
|
18
22
|
- High-risk feature to autostart client in-process has been removed without replacement
|
@@ -114,7 +118,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
114
118
|
### Changed
|
115
119
|
- Improve rails initializer code
|
116
120
|
|
117
|
-
[Unreleased]: https://github.com/jgraichen/msgr/compare/v1.3.
|
121
|
+
[Unreleased]: https://github.com/jgraichen/msgr/compare/v1.3.2...HEAD
|
122
|
+
[1.3.2]: https://github.com/jgraichen/msgr/compare/v1.3.1...v1.3.2
|
118
123
|
[1.3.1]: https://github.com/jgraichen/msgr/compare/v1.3.0...v1.3.1
|
119
124
|
[1.3.0]: https://github.com/jgraichen/msgr/compare/v1.2.0...v1.3.0
|
120
125
|
[1.2.0]: https://github.com/jgraichen/msgr/compare/v1.1.0...v1.2.0
|
data/lib/msgr/client.rb
CHANGED
@@ -21,7 +21,7 @@ module Msgr
|
|
21
21
|
@config.merge! config.symbolize_keys
|
22
22
|
|
23
23
|
@mutex = ::Mutex.new
|
24
|
-
@routes =
|
24
|
+
@routes = load_routes
|
25
25
|
@pid ||= ::Process.pid
|
26
26
|
|
27
27
|
log(:debug) { "Created new client on process ##{@pid}..." }
|
@@ -59,8 +59,6 @@ module Msgr
|
|
59
59
|
|
60
60
|
log(:debug) { "Start on #{uri}..." }
|
61
61
|
|
62
|
-
@routes << config[:routing_file] if config[:routing_file].present?
|
63
|
-
@routes.reload
|
64
62
|
connection.bind(@routes)
|
65
63
|
end
|
66
64
|
end
|
@@ -192,5 +190,12 @@ module Msgr
|
|
192
190
|
|
193
191
|
config
|
194
192
|
end
|
193
|
+
|
194
|
+
def load_routes
|
195
|
+
Routes.new.tap do |routes|
|
196
|
+
routes << config[:routing_file] if config[:routing_file].present?
|
197
|
+
routes.reload
|
198
|
+
end
|
199
|
+
end
|
195
200
|
end
|
196
201
|
end
|
data/lib/msgr/version.rb
CHANGED
@@ -60,16 +60,11 @@ describe Msgr::Client do
|
|
60
60
|
describe 'drain' do
|
61
61
|
subject(:drain) { client.drain }
|
62
62
|
|
63
|
+
let(:config) { {routing_file: 'spec/fixtures/msgr_routes_test_drain.rb'} }
|
63
64
|
let(:channel_stub) { instance_double('Msgr::Channel', prefetch: true) }
|
64
65
|
let(:queue_stub) { instance_double('Bunny::Queue', purge: true) }
|
65
66
|
|
66
67
|
before do
|
67
|
-
client.routes.configure do
|
68
|
-
route 'abc', to: 'consumer1#action1'
|
69
|
-
route 'def', to: 'consumer1#action2'
|
70
|
-
route 'ghi', to: 'consumer2#action1'
|
71
|
-
end
|
72
|
-
|
73
68
|
allow(Msgr::Channel).to receive(:new).and_return(channel_stub)
|
74
69
|
allow(channel_stub).to receive(:queue).and_return(queue_stub).at_most(3).times
|
75
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- msgr.gemspec
|
104
104
|
- scripts/simple_test.rb
|
105
105
|
- spec/fixtures/msgr_routes_test_1.rb
|
106
|
+
- spec/fixtures/msgr_routes_test_drain.rb
|
106
107
|
- spec/integration/dummy/Rakefile
|
107
108
|
- spec/integration/dummy/app/assets/config/manifest.js
|
108
109
|
- spec/integration/dummy/app/consumers/application_consumer.rb
|
@@ -160,12 +161,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
161
|
- !ruby/object:Gem::Version
|
161
162
|
version: '0'
|
162
163
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.2.4
|
164
165
|
signing_key:
|
165
166
|
specification_version: 4
|
166
167
|
summary: 'Msgr: Rails-like Messaging Framework'
|
167
168
|
test_files:
|
168
169
|
- spec/fixtures/msgr_routes_test_1.rb
|
170
|
+
- spec/fixtures/msgr_routes_test_drain.rb
|
169
171
|
- spec/integration/dummy/Rakefile
|
170
172
|
- spec/integration/dummy/app/assets/config/manifest.js
|
171
173
|
- spec/integration/dummy/app/consumers/application_consumer.rb
|