message_bus 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of message_bus might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -1
- data/README.md +4 -0
- data/lib/message_bus/rack/middleware.rb +6 -2
- data/lib/message_bus/version.rb +1 -1
- data/spec/lib/message_bus/rack/middleware_spec.rb +11 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '096c5bb55b64076beef0b89313a6424fb0ded08cb2988f0b79cc44dfc58cc4dd'
|
4
|
+
data.tar.gz: aceed48ea3dbc555fa4f9896f8cdb474fa543f20469659bc8bf05bcbdd8e20e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d906c4e50068024c76ea0019f9d376869fba3ea67d52cfae4a49d251f270b442723a3924b78eccdaddcc68963f0c040e91a37d92c9b396f2bf5340b213338328
|
7
|
+
data.tar.gz: c7ffa6dfd797b20c44e3e305f5de06c04a10a39fc708152c5479b50ca54baf3ebc2b3ff19a08f33949f31390370fded3ea934f39f8c10a0ac22f7a18ac8a341f
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -631,6 +631,10 @@ This message indicates the last ID in the backlog for each channel that the clie
|
|
631
631
|
|
632
632
|
The values provided in this status message can be used by the client to skip requesting messages it will never receive and move forward in polling.
|
633
633
|
|
634
|
+
### Publishing to MessageBus from outside of MessageBus
|
635
|
+
|
636
|
+
It may be necessary or desired for integration with existing systems to publish messages from outside the Ruby app where MessageBus is running. @tgodfrey has an example of how to do that, using the Redis backend, from Elixir here: https://gist.github.com/tgodfrey/1a67753d51cb202ca8eb04b933cec924.
|
637
|
+
|
634
638
|
## Contributing
|
635
639
|
|
636
640
|
If you are looking to contribute to this project here are some ideas
|
@@ -56,6 +56,12 @@ class MessageBus::Rack::Middleware
|
|
56
56
|
def call(env)
|
57
57
|
return @app.call(env) unless env['PATH_INFO'] =~ /^\/message-bus\//
|
58
58
|
|
59
|
+
handle_request(env)
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def handle_request(env)
|
59
65
|
# special debug/test route
|
60
66
|
if @bus.allow_broadcast? && env['PATH_INFO'] == '/message-bus/broadcast'
|
61
67
|
parsed = Rack::Request.new(env)
|
@@ -184,8 +190,6 @@ class MessageBus::Rack::Middleware
|
|
184
190
|
end
|
185
191
|
end
|
186
192
|
|
187
|
-
private
|
188
|
-
|
189
193
|
def close_db_connection!
|
190
194
|
# IMPORTANT
|
191
195
|
# ConnectionManagement in Rails puts a BodyProxy around stuff
|
data/lib/message_bus/version.rb
CHANGED
@@ -369,6 +369,17 @@ describe MessageBus::Rack::Middleware do
|
|
369
369
|
|
370
370
|
last_response.status.must_equal 407
|
371
371
|
end
|
372
|
+
|
373
|
+
it "does not handle exceptions from downstream middleware" do
|
374
|
+
@bus.on_middleware_error do |_env, err|
|
375
|
+
[404, {}, []]
|
376
|
+
end
|
377
|
+
|
378
|
+
get("/")
|
379
|
+
|
380
|
+
last_response.status.must_equal 500
|
381
|
+
last_response.body.must_equal 'should not be called'
|
382
|
+
end
|
372
383
|
end
|
373
384
|
|
374
385
|
describe "messagebus.channels env support" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: message_bus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -155,8 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
|
-
|
159
|
-
rubygems_version: 2.7.6
|
158
|
+
rubygems_version: 3.0.3
|
160
159
|
signing_key:
|
161
160
|
specification_version: 4
|
162
161
|
summary: ''
|