message_bus 4.3.8 → 4.3.9
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 +4 -4
- data/.github/workflows/ci.yml +35 -21
- data/.rubocop.yml +6 -2
- data/CHANGELOG +8 -2
- data/Rakefile +2 -4
- data/lib/message_bus/backends/base.rb +0 -1
- data/lib/message_bus/backends/postgres.rb +1 -1
- data/lib/message_bus/backends/redis.rb +1 -1
- data/lib/message_bus/rack/middleware.rb +5 -1
- data/lib/message_bus/version.rb +1 -1
- data/lib/message_bus.rb +1 -2
- data/message_bus.gemspec +4 -2
- data/package-lock.json +386 -186
- data/spec/lib/message_bus/multi_process_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +7 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 258a314e3749265bd7fbaa9fadcaba10a3e4fdb46d204787ccc96effecdcbc7c
|
4
|
+
data.tar.gz: b14add0ef9b398c2adf721adb725d7dbeb2719066f694e753fde7073a06da502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebc4a907f665282f748fef892398b203b71888c98800350d7061ee870d7848a8a3f1034d501ccb162c5d099dee9edbc411a950921ce063ccac7a7ac58e60e995
|
7
|
+
data.tar.gz: 9b454a1f78c88351865bb277c2831b4f9772113ad865793f7d05ef531816600f828a4cc18f461a969db002038a30b5ae2d472bdd4128b7a0ccf8d2bfab6e6067
|
data/.github/workflows/ci.yml
CHANGED
@@ -7,7 +7,34 @@ on:
|
|
7
7
|
pull_request:
|
8
8
|
|
9
9
|
jobs:
|
10
|
-
|
10
|
+
lint:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
timeout-minutes: 5
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v4
|
16
|
+
|
17
|
+
- uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: "3.3"
|
20
|
+
bundler-cache: true
|
21
|
+
|
22
|
+
- name: Set up Node.js
|
23
|
+
uses: actions/setup-node@v4
|
24
|
+
with:
|
25
|
+
node-version: 20
|
26
|
+
cache: npm
|
27
|
+
|
28
|
+
- name: Setup npm
|
29
|
+
run: npm install
|
30
|
+
|
31
|
+
- name: Rubocop
|
32
|
+
run: bundle exec rubocop
|
33
|
+
|
34
|
+
- name: ESLint
|
35
|
+
run: npx eslint .
|
36
|
+
|
37
|
+
test:
|
11
38
|
runs-on: ubuntu-latest
|
12
39
|
name: Ruby ${{ matrix.ruby }} (redis ${{ matrix.redis }})
|
13
40
|
timeout-minutes: 10
|
@@ -20,12 +47,12 @@ jobs:
|
|
20
47
|
strategy:
|
21
48
|
fail-fast: false
|
22
49
|
matrix:
|
23
|
-
ruby: [2.6, 2.7,
|
50
|
+
ruby: ["2.6", "2.7", "3.0", "3.1"]
|
24
51
|
redis: [5, 6]
|
25
52
|
|
26
53
|
services:
|
27
54
|
postgres:
|
28
|
-
image: postgres:
|
55
|
+
image: postgres:16
|
29
56
|
env:
|
30
57
|
POSTGRES_DB: message_bus_test
|
31
58
|
POSTGRES_PASSWORD: postgres
|
@@ -43,41 +70,28 @@ jobs:
|
|
43
70
|
--health-retries 5
|
44
71
|
|
45
72
|
steps:
|
46
|
-
- uses: actions/checkout@
|
73
|
+
- uses: actions/checkout@v4
|
47
74
|
|
48
75
|
- uses: ruby/setup-ruby@v1
|
49
76
|
with:
|
50
77
|
ruby-version: ${{ matrix.ruby }}
|
51
78
|
bundler-cache: true
|
52
79
|
|
53
|
-
- name: Set up Node.js
|
54
|
-
uses: actions/setup-node@v3
|
55
|
-
with:
|
56
|
-
node-version: 18
|
57
|
-
cache: npm
|
58
|
-
|
59
|
-
- name: Setup npm
|
60
|
-
run: npm install
|
61
|
-
|
62
80
|
- name: Tests
|
63
81
|
env:
|
64
82
|
TESTOPTS: --verbose
|
65
83
|
run: bundle exec rake
|
66
|
-
timeout-minutes: 3
|
67
|
-
|
68
|
-
- name: Linting
|
69
|
-
run: npx eslint .
|
70
84
|
|
71
85
|
publish:
|
72
86
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
73
|
-
needs:
|
87
|
+
needs: [lint, test]
|
74
88
|
runs-on: ubuntu-latest
|
75
89
|
|
76
90
|
steps:
|
77
|
-
- uses: actions/checkout@
|
91
|
+
- uses: actions/checkout@v4
|
78
92
|
|
79
93
|
- name: Release gem
|
80
|
-
uses: discourse/publish-rubygems-action@
|
94
|
+
uses: discourse/publish-rubygems-action@v3
|
81
95
|
id: publish-gem
|
82
96
|
env:
|
83
97
|
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
@@ -95,7 +109,7 @@ jobs:
|
|
95
109
|
git commit -m 'bump'
|
96
110
|
|
97
111
|
- name: Publish package
|
98
|
-
uses: JS-DevTools/npm-publish@
|
112
|
+
uses: JS-DevTools/npm-publish@v3
|
99
113
|
if: steps.publish-gem.outputs.new_version == 'true'
|
100
114
|
with:
|
101
115
|
token: ${{ secrets.NPM_TOKEN }}
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
inherit_gem:
|
2
|
-
rubocop-discourse: .
|
2
|
+
rubocop-discourse: stree-compat.yml
|
3
3
|
inherit_mode:
|
4
4
|
merge:
|
5
5
|
- Exclude
|
6
|
+
|
6
7
|
AllCops:
|
7
8
|
Exclude:
|
8
|
-
-
|
9
|
+
- "examples/**/*"
|
10
|
+
|
11
|
+
Discourse/Plugins:
|
12
|
+
Enabled: false
|
9
13
|
|
10
14
|
RSpec:
|
11
15
|
Enabled: false
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
18-02-2025
|
2
|
+
|
3
|
+
- Version 4.3.9
|
4
|
+
|
5
|
+
- Prevent deprecation warning when using Rails 7.1
|
6
|
+
|
1
7
|
14-09-2023
|
2
8
|
|
3
9
|
- Version 4.3.8
|
@@ -42,13 +48,13 @@
|
|
42
48
|
|
43
49
|
06-01-2023
|
44
50
|
|
45
|
-
- Version 4.
|
51
|
+
- Version 4.3.1
|
46
52
|
|
47
53
|
- FIX: Ensure non-long-polling requests are always spaced out
|
48
54
|
|
49
55
|
04-11-2022
|
50
56
|
|
51
|
-
- Version 4.
|
57
|
+
- Version 4.3.0
|
52
58
|
|
53
59
|
- FIX: Add redis gem version 5 support
|
54
60
|
- FEATURE: Allow disabling subscriptions without disabling publication
|
data/Rakefile
CHANGED
@@ -4,12 +4,10 @@ require 'rake/testtask'
|
|
4
4
|
require 'bundler'
|
5
5
|
require 'bundler/gem_tasks'
|
6
6
|
require 'bundler/setup'
|
7
|
-
require 'rubocop/rake_task'
|
8
7
|
require 'yard'
|
9
8
|
|
10
9
|
Bundler.require(:default, :test)
|
11
10
|
|
12
|
-
RuboCop::RakeTask.new
|
13
11
|
YARD::Rake::YardocTask.new
|
14
12
|
|
15
13
|
BACKENDS = Dir["lib/message_bus/backends/*.rb"].map { |file| file.match(%r{backends/(?<backend>.*).rb})[:backend] } - ["base"]
|
@@ -99,5 +97,5 @@ task :performance do
|
|
99
97
|
end
|
100
98
|
end
|
101
99
|
|
102
|
-
desc "Run all tests
|
103
|
-
task default: [:spec, :
|
100
|
+
desc "Run all tests and confirm the documentation compiles without error"
|
101
|
+
task default: [:spec, :test_doc]
|
@@ -48,7 +48,6 @@ module MessageBus
|
|
48
48
|
#
|
49
49
|
# @abstract
|
50
50
|
class Base
|
51
|
-
# rubocop:disable Lint/UnusedMethodArgument
|
52
51
|
|
53
52
|
# Raised to indicate that the concrete backend implementation does not implement part of the API
|
54
53
|
ConcreteClassMustImplementError = Class.new(StandardError)
|
@@ -200,7 +200,11 @@ class MessageBus::Rack::Middleware
|
|
200
200
|
# this means connections are not returned until rack.async is
|
201
201
|
# closed
|
202
202
|
if defined? ActiveRecord::Base.connection_handler
|
203
|
-
|
203
|
+
if Gem::Version.new(Rails.version) >= "7.1"
|
204
|
+
ActiveRecord::Base.connection_handler.clear_active_connections!(:all)
|
205
|
+
else
|
206
|
+
ActiveRecord::Base.connection_handler.clear_active_connections!
|
207
|
+
end
|
204
208
|
elsif defined? ActiveRecord::Base.clear_active_connections!
|
205
209
|
ActiveRecord::Base.clear_active_connections!
|
206
210
|
end
|
data/lib/message_bus/version.rb
CHANGED
data/lib/message_bus.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "monitor"
|
4
|
-
require "set"
|
5
4
|
|
6
5
|
require_relative "message_bus/version"
|
7
6
|
require_relative "message_bus/message"
|
@@ -772,7 +771,7 @@ module MessageBus::Implementation
|
|
772
771
|
globals, locals, local_globals, global_globals = nil
|
773
772
|
|
774
773
|
@mutex.synchronize do
|
775
|
-
return if @destroyed
|
774
|
+
return if @destroyed # rubocop:disable Lint/NonLocalExitFromIterator
|
776
775
|
next unless @subscriptions
|
777
776
|
|
778
777
|
globals = @subscriptions[nil]
|
data/message_bus.gemspec
CHANGED
@@ -35,6 +35,8 @@ Gem::Specification.new do |gem|
|
|
35
35
|
gem.add_development_dependency 'byebug'
|
36
36
|
gem.add_development_dependency 'oj'
|
37
37
|
gem.add_development_dependency 'yard'
|
38
|
-
|
39
|
-
|
38
|
+
|
39
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
|
40
|
+
gem.add_development_dependency 'rubocop-discourse', '3.8.1'
|
41
|
+
end
|
40
42
|
end
|