ears 0.26.0 → 0.27.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 +4 -4
- data/.github/dependabot.yml +23 -11
- data/.github/workflows/build.yml +9 -5
- data/.github/workflows/codeql.yml +1 -1
- data/.github/workflows/dependency-review.yml +1 -1
- data/.prettierignore +1 -0
- data/.rubocop.yml +6 -0
- data/.tool-versions +2 -2
- data/CHANGELOG.md +12 -0
- data/CLAUDE.md +4 -2
- data/Gemfile +4 -0
- data/Gemfile.lock +33 -40
- data/Rakefile +1 -1
- data/lib/ears/publisher_channel_pool.rb +13 -23
- data/lib/ears/publisher_confirmation_handler.rb +1 -3
- data/lib/ears/version.rb +1 -1
- data/package.json +5 -4
- data/pnpm-lock.yaml +48 -0
- metadata +4 -3
- data/package-lock.json +0 -71
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 734c223f712b45458b8ff4e708b2f5357c434bd04e7fa8484a1b8af1eb864704
|
|
4
|
+
data.tar.gz: c73c51588a43bbc02772b0ba9a5b1afde23568e2b72da4aa77e992333ed4332c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de36a79e2994349c4d6156857d3fd49e380ae224341c0a7476c3ae45a651f9ca17375e69984d3b0a762c30c2815c06933372baabc18364c95a4ec1d4ce9f2f3a
|
|
7
|
+
data.tar.gz: 14425c85eada0c363fc0f3be960df6adfad43a52ae502261eb7aad8f9a3bc98f8a76f2a00fa9e96595002c1783cfcb85ea1394914306ff3f25c9e9f8ddd45483
|
data/.github/dependabot.yml
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
version: 2
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
updates:
|
|
4
|
+
- package-ecosystem: 'bundler'
|
|
5
|
+
directory: '/'
|
|
5
6
|
schedule:
|
|
6
7
|
interval: 'daily'
|
|
7
|
-
open-pull-requests-limit: 0
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
open-pull-requests-limit: 0
|
|
9
|
+
groups:
|
|
10
|
+
security:
|
|
11
|
+
applies-to: security-updates
|
|
12
|
+
patterns: ['*']
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
- package-ecosystem: 'bundler'
|
|
14
|
+
- package-ecosystem: 'npm'
|
|
13
15
|
directory: '/'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
schedule:
|
|
17
|
+
interval: 'daily'
|
|
18
|
+
open-pull-requests-limit: 0
|
|
19
|
+
groups:
|
|
20
|
+
security:
|
|
21
|
+
applies-to: security-updates
|
|
22
|
+
patterns: ['*']
|
|
16
23
|
|
|
17
24
|
- package-ecosystem: 'github-actions'
|
|
18
25
|
directory: '/'
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
schedule:
|
|
27
|
+
interval: 'daily'
|
|
28
|
+
open-pull-requests-limit: 0
|
|
29
|
+
groups:
|
|
30
|
+
security:
|
|
31
|
+
applies-to: security-updates
|
|
32
|
+
patterns: ['*']
|
data/.github/workflows/build.yml
CHANGED
|
@@ -15,17 +15,21 @@ jobs:
|
|
|
15
15
|
ruby-version: ['3.3', '3.4', '4.0']
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
19
|
- name: Set up Ruby
|
|
20
20
|
uses: ruby/setup-ruby@v1
|
|
21
21
|
with:
|
|
22
22
|
ruby-version: ${{ matrix.ruby-version }}
|
|
23
23
|
bundler-cache: true
|
|
24
|
-
- uses:
|
|
24
|
+
- uses: pnpm/action-setup@v6
|
|
25
25
|
with:
|
|
26
|
-
|
|
26
|
+
run_install: false
|
|
27
|
+
- uses: actions/setup-node@v7
|
|
28
|
+
with:
|
|
29
|
+
node-version: '26'
|
|
30
|
+
cache: pnpm
|
|
27
31
|
- name: Run prettier
|
|
28
|
-
run:
|
|
32
|
+
run: pnpm install --frozen-lockfile && pnpm run lint
|
|
29
33
|
- name: Run Rubocop
|
|
30
34
|
run: bundle exec rubocop
|
|
31
35
|
- name: Run tests
|
|
@@ -37,7 +41,7 @@ jobs:
|
|
|
37
41
|
runs-on: ubuntu-latest
|
|
38
42
|
|
|
39
43
|
steps:
|
|
40
|
-
- uses: actions/checkout@
|
|
44
|
+
- uses: actions/checkout@v7
|
|
41
45
|
- name: Set up Ruby
|
|
42
46
|
uses: ruby/setup-ruby@v1
|
|
43
47
|
with:
|
data/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pnpm-lock.yaml
|
data/.rubocop.yml
CHANGED
|
@@ -93,3 +93,9 @@ RSpec/MultipleMemoizedHelpers:
|
|
|
93
93
|
|
|
94
94
|
RSpec/StubbedMock:
|
|
95
95
|
Enabled: false
|
|
96
|
+
|
|
97
|
+
# `have_been_published` takes the search criteria as its subject rather than a
|
|
98
|
+
# value under test, so `expect(routing_key: '…')` is the matcher's intended API.
|
|
99
|
+
RSpec/ExpectActual:
|
|
100
|
+
Exclude:
|
|
101
|
+
- 'spec/ears/testing/matchers_spec.rb'
|
data/.tool-versions
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
ruby 4.0.
|
|
2
|
-
nodejs
|
|
1
|
+
ruby 4.0.7
|
|
2
|
+
nodejs 26.8.2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.27.0 (2026-10-02)
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- A publisher channel that is closed when it is returned to the pool is now discarded instead of resetting the whole pool. A failed publish confirmation no longer closes the channels other threads are publishing on.
|
|
8
|
+
|
|
9
|
+
## 0.26.1 (2026-10-01)
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Resetting a publisher channel pool while a closed channel is checked out no longer raises `Bunny::ChannelAlreadyClosed` on checkin. Previously this masked the original error (e.g. `PublishConfirmationTimeout`) and caused it to be retried as a connection error, which could duplicate a message.
|
|
14
|
+
|
|
3
15
|
## 0.26.0 (2026-06-01)
|
|
4
16
|
|
|
5
17
|
- Upgrade `connection_pool` dependency to `~> 3.0`
|
data/CLAUDE.md
CHANGED
|
@@ -9,20 +9,22 @@ Ruby gem for building RabbitMQ consumers using Bunny.
|
|
|
9
9
|
- **connection_pool** ~> 3.0 — thread-safe channel pools for publishers
|
|
10
10
|
- **json** >= 2.9.0 — JSON serialization in middleware
|
|
11
11
|
- Dev tools: RSpec, RuboCop (rubocop-rspec, rubocop-rake), SimpleCov, YARD, Prettier (via Node)
|
|
12
|
+
- **Node tooling**: pnpm v11+ (pinned in `package.json#packageManager`). The JS toolchain is dev-only (Prettier on Ruby files); nothing JS ships at runtime.
|
|
12
13
|
|
|
13
14
|
## Common Commands
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
17
|
# Install deps
|
|
17
18
|
bundle install
|
|
18
|
-
|
|
19
|
+
pnpm install --frozen-lockfile
|
|
19
20
|
|
|
20
21
|
# Tests
|
|
21
22
|
bundle exec rspec
|
|
22
23
|
|
|
23
24
|
# Lint / format
|
|
24
25
|
bundle exec rubocop
|
|
25
|
-
|
|
26
|
+
pnpm run lint # Prettier on Ruby files
|
|
27
|
+
pnpm run format # Prettier --write
|
|
26
28
|
|
|
27
29
|
# Autofix rubocop
|
|
28
30
|
bundle exec rubocop -A
|
data/Gemfile
CHANGED
|
@@ -3,6 +3,10 @@ source 'https://rubygems.org'
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
5
|
group :test do
|
|
6
|
+
# @prettier/plugin-ruby's vendored server.rb still calls JSON.fast_generate,
|
|
7
|
+
# removed in json 3.0 (https://github.com/ruby/json/releases/tag/v3.0.0).
|
|
8
|
+
# Remove this pin once https://github.com/prettier/plugin-ruby/pull/1468 merges and ships.
|
|
9
|
+
gem 'json', '< 3'
|
|
6
10
|
gem 'rake'
|
|
7
11
|
gem 'rspec'
|
|
8
12
|
gem 'rubocop', require: false
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ears (0.
|
|
4
|
+
ears (0.27.0)
|
|
5
5
|
bunny (>= 3.0.0)
|
|
6
6
|
connection_pool (~> 3.0)
|
|
7
7
|
json (>= 2.9.0)
|
|
@@ -9,21 +9,20 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
amq-protocol (2.
|
|
12
|
+
amq-protocol (2.9.0)
|
|
13
13
|
ast (2.4.3)
|
|
14
|
-
bunny (3.
|
|
15
|
-
amq-protocol (~> 2.
|
|
14
|
+
bunny (3.3.0)
|
|
15
|
+
amq-protocol (~> 2.9)
|
|
16
16
|
logger (~> 1, >= 1.7)
|
|
17
17
|
sorted_set (~> 1, >= 1.0.2)
|
|
18
18
|
connection_pool (3.0.2)
|
|
19
19
|
diff-lcs (1.6.2)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
language_server-protocol (3.17.0.5)
|
|
20
|
+
json (2.21.2)
|
|
21
|
+
language_server-protocol (3.17.0.6)
|
|
23
22
|
lint_roller (1.1.0)
|
|
24
23
|
logger (1.7.0)
|
|
25
|
-
parallel (2.
|
|
26
|
-
parser (3.3.
|
|
24
|
+
parallel (2.2.0)
|
|
25
|
+
parser (3.3.12.0)
|
|
27
26
|
ast (~> 2.4.1)
|
|
28
27
|
racc
|
|
29
28
|
prettier_print (1.2.1)
|
|
@@ -31,7 +30,7 @@ GEM
|
|
|
31
30
|
racc (1.8.1)
|
|
32
31
|
rainbow (3.1.1)
|
|
33
32
|
rake (13.4.2)
|
|
34
|
-
rbtree (0.4.
|
|
33
|
+
rbtree (0.4.7)
|
|
35
34
|
regexp_parser (2.12.0)
|
|
36
35
|
rspec (3.13.2)
|
|
37
36
|
rspec-core (~> 3.13.0)
|
|
@@ -46,8 +45,8 @@ GEM
|
|
|
46
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
47
46
|
rspec-support (~> 3.13.0)
|
|
48
47
|
rspec-support (3.13.7)
|
|
49
|
-
rubocop (1.
|
|
50
|
-
json (
|
|
48
|
+
rubocop (1.91.0)
|
|
49
|
+
json (>= 2.3)
|
|
51
50
|
language_server-protocol (~> 3.17.0.2)
|
|
52
51
|
lint_roller (~> 1.1.0)
|
|
53
52
|
parallel (>= 1.10)
|
|
@@ -57,22 +56,18 @@ GEM
|
|
|
57
56
|
rubocop-ast (>= 1.49.0, < 2.0)
|
|
58
57
|
ruby-progressbar (~> 1.7)
|
|
59
58
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
60
|
-
rubocop-ast (1.
|
|
59
|
+
rubocop-ast (1.50.0)
|
|
61
60
|
parser (>= 3.3.7.2)
|
|
62
61
|
prism (~> 1.7)
|
|
63
62
|
rubocop-rake (0.7.1)
|
|
64
63
|
lint_roller (~> 1.1)
|
|
65
64
|
rubocop (>= 1.72.1)
|
|
66
|
-
rubocop-rspec (3.
|
|
65
|
+
rubocop-rspec (3.10.2)
|
|
67
66
|
lint_roller (~> 1.1)
|
|
68
|
-
|
|
67
|
+
regexp_parser (>= 2.0)
|
|
68
|
+
rubocop (~> 1.86, >= 1.86.2)
|
|
69
69
|
ruby-progressbar (1.13.0)
|
|
70
|
-
simplecov (
|
|
71
|
-
docile (~> 1.1)
|
|
72
|
-
simplecov-html (~> 0.11)
|
|
73
|
-
simplecov_json_formatter (~> 0.1)
|
|
74
|
-
simplecov-html (0.13.2)
|
|
75
|
-
simplecov_json_formatter (0.1.4)
|
|
70
|
+
simplecov (1.3.0)
|
|
76
71
|
sorted_set (1.1.0)
|
|
77
72
|
rbtree
|
|
78
73
|
syntax_tree (6.3.0)
|
|
@@ -80,7 +75,7 @@ GEM
|
|
|
80
75
|
unicode-display_width (3.2.0)
|
|
81
76
|
unicode-emoji (~> 4.1)
|
|
82
77
|
unicode-emoji (4.2.0)
|
|
83
|
-
yard (0.9.
|
|
78
|
+
yard (0.9.45)
|
|
84
79
|
|
|
85
80
|
PLATFORMS
|
|
86
81
|
arm64-darwin
|
|
@@ -90,6 +85,7 @@ PLATFORMS
|
|
|
90
85
|
|
|
91
86
|
DEPENDENCIES
|
|
92
87
|
ears!
|
|
88
|
+
json (< 3)
|
|
93
89
|
rake
|
|
94
90
|
rspec
|
|
95
91
|
rubocop
|
|
@@ -100,45 +96,42 @@ DEPENDENCIES
|
|
|
100
96
|
yard
|
|
101
97
|
|
|
102
98
|
CHECKSUMS
|
|
103
|
-
amq-protocol (2.
|
|
99
|
+
amq-protocol (2.9.0) sha256=6812dc5c1d7dea12b445854ad0000239e59009760079084310bd39f76397168e
|
|
104
100
|
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
105
|
-
bundler (4.0.
|
|
106
|
-
bunny (3.
|
|
101
|
+
bundler (4.0.21) sha256=7cbf5499b426076aa16c8d28a59e4c2c3aad5a438402abcd961f0119f29f1dd0
|
|
102
|
+
bunny (3.3.0) sha256=85ef5562ec2b24f542e8fad69c4302d30d966fb79ff803dc9d0c398a4054672a
|
|
107
103
|
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
108
104
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
|
|
105
|
+
ears (0.27.0)
|
|
106
|
+
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
|
|
107
|
+
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
|
|
113
108
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
114
109
|
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
115
|
-
parallel (2.
|
|
116
|
-
parser (3.3.
|
|
110
|
+
parallel (2.2.0) sha256=e1059c5fd7b649558a0aec38a769f06a42942bdb40503d005a59c352fe011cd8
|
|
111
|
+
parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
|
|
117
112
|
prettier_print (1.2.1) sha256=a72838b5f23facff21f90a5423cdcdda19e4271092b41f4ea7f50b83929e6ff9
|
|
118
113
|
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
119
114
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
120
115
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
121
116
|
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
122
|
-
rbtree (0.4.
|
|
117
|
+
rbtree (0.4.7) sha256=1efabbcb3fd5f12249c9c8a610a765074868164eed0c50c9db2531c00ed161cb
|
|
123
118
|
regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
|
|
124
119
|
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
|
|
125
120
|
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
|
|
126
121
|
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
|
|
127
122
|
rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
|
|
128
123
|
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
|
|
129
|
-
rubocop (1.
|
|
130
|
-
rubocop-ast (1.
|
|
124
|
+
rubocop (1.91.0) sha256=9c82b7bf391c5d7e3798c5b9996e22a1fe3bd7468e351dfdeb96140c058296d0
|
|
125
|
+
rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
|
|
131
126
|
rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
|
|
132
|
-
rubocop-rspec (3.
|
|
127
|
+
rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
|
|
133
128
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
134
|
-
simplecov (
|
|
135
|
-
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
|
|
136
|
-
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
|
|
129
|
+
simplecov (1.3.0) sha256=d9886307863c1ead47657dcbed869bfffd82318808b09014d8f0ff77dcfe7492
|
|
137
130
|
sorted_set (1.1.0) sha256=bac01eb16b6bcfcdb7d732a28e87422be8b5c9fdcfeadbe9072682407524ee83
|
|
138
131
|
syntax_tree (6.3.0) sha256=56e25a9692c798ec94c5442fe94c5e94af76bef91edc8bb02052cbdecf35f13d
|
|
139
132
|
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
|
|
140
133
|
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
|
|
141
|
-
yard (0.9.
|
|
134
|
+
yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51
|
|
142
135
|
|
|
143
136
|
BUNDLED WITH
|
|
144
|
-
4.0.
|
|
137
|
+
4.0.21
|
data/Rakefile
CHANGED
|
@@ -18,8 +18,14 @@ module Ears
|
|
|
18
18
|
|
|
19
19
|
pool = confirms ? confirms_pool : standard_pool
|
|
20
20
|
pool.with do |channel|
|
|
21
|
-
|
|
21
|
+
unless channel.open?
|
|
22
|
+
raise PublisherRetryHandler::PublishToStaleChannelError,
|
|
23
|
+
'Channel is closed'
|
|
24
|
+
end
|
|
25
|
+
|
|
22
26
|
block.call(channel)
|
|
27
|
+
ensure
|
|
28
|
+
pool.discard_current_connection unless channel.open?
|
|
23
29
|
end
|
|
24
30
|
end
|
|
25
31
|
|
|
@@ -34,8 +40,8 @@ module Ears
|
|
|
34
40
|
@confirms_pool = nil
|
|
35
41
|
@creator_pid = nil
|
|
36
42
|
|
|
37
|
-
std_pool&.shutdown(
|
|
38
|
-
cnf_pool&.shutdown(
|
|
43
|
+
std_pool&.shutdown { |channel| close_channel(channel) }
|
|
44
|
+
cnf_pool&.shutdown { |channel| close_channel(channel) }
|
|
39
45
|
nil
|
|
40
46
|
end
|
|
41
47
|
|
|
@@ -47,7 +53,7 @@ module Ears
|
|
|
47
53
|
cnf_pool = @confirms_pool
|
|
48
54
|
@confirms_pool = nil
|
|
49
55
|
|
|
50
|
-
cnf_pool&.shutdown(
|
|
56
|
+
cnf_pool&.shutdown { |channel| close_channel(channel) }
|
|
51
57
|
nil
|
|
52
58
|
end
|
|
53
59
|
|
|
@@ -102,26 +108,10 @@ module Ears
|
|
|
102
108
|
@init_mutex ||= Mutex.new
|
|
103
109
|
end
|
|
104
110
|
|
|
105
|
-
def
|
|
106
|
-
return if channel.open?
|
|
107
|
-
|
|
108
|
-
cleanup_closed_channel(channel)
|
|
109
|
-
reset_appropriate_pool(confirms)
|
|
110
|
-
|
|
111
|
-
raise PublisherRetryHandler::PublishToStaleChannelError,
|
|
112
|
-
'Channel is closed'
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
def cleanup_closed_channel(channel)
|
|
116
|
-
return unless channel.respond_to?(:close)
|
|
117
|
-
|
|
111
|
+
def close_channel(channel)
|
|
118
112
|
channel.close
|
|
119
|
-
rescue
|
|
120
|
-
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
def reset_appropriate_pool(confirms)
|
|
124
|
-
confirms ? reset_confirms_pool! : reset!
|
|
113
|
+
rescue Bunny::ChannelAlreadyClosed
|
|
114
|
+
nil
|
|
125
115
|
end
|
|
126
116
|
end
|
|
127
117
|
end
|
|
@@ -4,7 +4,7 @@ module Ears
|
|
|
4
4
|
# Handles publisher confirmations for RabbitMQ messages.
|
|
5
5
|
#
|
|
6
6
|
# This class encapsulates the logic for publishing messages with confirmations,
|
|
7
|
-
# including timeout handling
|
|
7
|
+
# including timeout handling and channel cleanup.
|
|
8
8
|
class PublisherConfirmationHandler
|
|
9
9
|
# Creates a new confirmation handler.
|
|
10
10
|
#
|
|
@@ -72,8 +72,6 @@ module Ears
|
|
|
72
72
|
warn("Failed closing channel on failed confirmation: #{e.message}")
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
PublisherChannelPool.reset_confirms_pool!
|
|
76
|
-
|
|
77
75
|
if channel.nacked_set&.any?
|
|
78
76
|
warn('Publisher confirmation failed: message was nacked by broker.')
|
|
79
77
|
raise PublishNacked, 'Message was nacked by broker'
|
data/lib/ears/version.rb
CHANGED
data/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ears",
|
|
3
3
|
"private": true,
|
|
4
|
+
"packageManager": "pnpm@11.18.0",
|
|
4
5
|
"scripts": {
|
|
5
|
-
"prettify": "prettier \"**/*.{ru,rb,yml,yaml,md,gemspec,json}\"
|
|
6
|
-
"lint": "
|
|
7
|
-
"format": "
|
|
6
|
+
"prettify": "prettier \"**/*.{ru,rb,yml,yaml,md,gemspec,json}\"",
|
|
7
|
+
"lint": "pnpm run prettify --check",
|
|
8
|
+
"format": "pnpm run prettify --write"
|
|
8
9
|
},
|
|
9
10
|
"devDependencies": {
|
|
10
11
|
"@invisionag/prettier-config": "^2.1.3",
|
|
11
12
|
"@prettier/plugin-ruby": "^4.0.4",
|
|
12
|
-
"prettier": "^3.
|
|
13
|
+
"prettier": "^3.9.6"
|
|
13
14
|
},
|
|
14
15
|
"prettier": "@invisionag/prettier-config/ruby"
|
|
15
16
|
}
|
data/pnpm-lock.yaml
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
lockfileVersion: '9.0'
|
|
2
|
+
|
|
3
|
+
settings:
|
|
4
|
+
autoInstallPeers: true
|
|
5
|
+
excludeLinksFromLockfile: false
|
|
6
|
+
|
|
7
|
+
importers:
|
|
8
|
+
|
|
9
|
+
.:
|
|
10
|
+
devDependencies:
|
|
11
|
+
'@invisionag/prettier-config':
|
|
12
|
+
specifier: ^2.1.3
|
|
13
|
+
version: 2.1.3(prettier@3.9.6)
|
|
14
|
+
'@prettier/plugin-ruby':
|
|
15
|
+
specifier: ^4.0.4
|
|
16
|
+
version: 4.0.4(prettier@3.9.6)
|
|
17
|
+
prettier:
|
|
18
|
+
specifier: ^3.9.6
|
|
19
|
+
version: 3.9.6
|
|
20
|
+
|
|
21
|
+
packages:
|
|
22
|
+
|
|
23
|
+
'@invisionag/prettier-config@2.1.3':
|
|
24
|
+
resolution: {integrity: sha512-/BRe7iCWtsn43hhYrD2ANla2Qf332EusDjcuuB9xOK/z3lEghp59pkuxNFIvlQ/Y9AFMaT1zOFhvxzYax+fj3g==}
|
|
25
|
+
peerDependencies:
|
|
26
|
+
prettier: '>=2.0.0'
|
|
27
|
+
|
|
28
|
+
'@prettier/plugin-ruby@4.0.4':
|
|
29
|
+
resolution: {integrity: sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==}
|
|
30
|
+
peerDependencies:
|
|
31
|
+
prettier: ^3.0.0
|
|
32
|
+
|
|
33
|
+
prettier@3.9.6:
|
|
34
|
+
resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==}
|
|
35
|
+
engines: {node: '>=14'}
|
|
36
|
+
hasBin: true
|
|
37
|
+
|
|
38
|
+
snapshots:
|
|
39
|
+
|
|
40
|
+
'@invisionag/prettier-config@2.1.3(prettier@3.9.6)':
|
|
41
|
+
dependencies:
|
|
42
|
+
prettier: 3.9.6
|
|
43
|
+
|
|
44
|
+
'@prettier/plugin-ruby@4.0.4(prettier@3.9.6)':
|
|
45
|
+
dependencies:
|
|
46
|
+
prettier: 3.9.6
|
|
47
|
+
|
|
48
|
+
prettier@3.9.6: {}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ears
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.27.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- InVision AG
|
|
@@ -63,6 +63,7 @@ files:
|
|
|
63
63
|
- ".github/workflows/codeql.yml"
|
|
64
64
|
- ".github/workflows/dependency-review.yml"
|
|
65
65
|
- ".gitignore"
|
|
66
|
+
- ".prettierignore"
|
|
66
67
|
- ".rspec"
|
|
67
68
|
- ".rubocop.yml"
|
|
68
69
|
- ".rubocop_todo.yml"
|
|
@@ -98,8 +99,8 @@ files:
|
|
|
98
99
|
- lib/ears/testing/publisher_mock.rb
|
|
99
100
|
- lib/ears/testing/test_helper.rb
|
|
100
101
|
- lib/ears/version.rb
|
|
101
|
-
- package-lock.json
|
|
102
102
|
- package.json
|
|
103
|
+
- pnpm-lock.yaml
|
|
103
104
|
homepage: https://github.com/ivx/ears
|
|
104
105
|
licenses:
|
|
105
106
|
- MIT
|
|
@@ -123,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
123
124
|
- !ruby/object:Gem::Version
|
|
124
125
|
version: '0'
|
|
125
126
|
requirements: []
|
|
126
|
-
rubygems_version: 4.0.
|
|
127
|
+
rubygems_version: 4.0.20
|
|
127
128
|
specification_version: 4
|
|
128
129
|
summary: A gem for building RabbitMQ consumers.
|
|
129
130
|
test_files: []
|
data/package-lock.json
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ears",
|
|
3
|
-
"lockfileVersion": 2,
|
|
4
|
-
"requires": true,
|
|
5
|
-
"packages": {
|
|
6
|
-
"": {
|
|
7
|
-
"name": "ears",
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@invisionag/prettier-config": "^2.1.3",
|
|
10
|
-
"@prettier/plugin-ruby": "^4.0.4",
|
|
11
|
-
"prettier": "^3.8.3"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"node_modules/@invisionag/prettier-config": {
|
|
15
|
-
"version": "2.1.3",
|
|
16
|
-
"resolved": "https://registry.npmjs.org/@invisionag/prettier-config/-/prettier-config-2.1.3.tgz",
|
|
17
|
-
"integrity": "sha512-/BRe7iCWtsn43hhYrD2ANla2Qf332EusDjcuuB9xOK/z3lEghp59pkuxNFIvlQ/Y9AFMaT1zOFhvxzYax+fj3g==",
|
|
18
|
-
"dev": true,
|
|
19
|
-
"peerDependencies": {
|
|
20
|
-
"prettier": ">=2.0.0"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"node_modules/@prettier/plugin-ruby": {
|
|
24
|
-
"version": "4.0.4",
|
|
25
|
-
"resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz",
|
|
26
|
-
"integrity": "sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==",
|
|
27
|
-
"dev": true,
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"prettier": "^3.0.0"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"node_modules/prettier": {
|
|
33
|
-
"version": "3.8.3",
|
|
34
|
-
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz",
|
|
35
|
-
"integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
|
|
36
|
-
"dev": true,
|
|
37
|
-
"license": "MIT",
|
|
38
|
-
"bin": {
|
|
39
|
-
"prettier": "bin/prettier.cjs"
|
|
40
|
-
},
|
|
41
|
-
"engines": {
|
|
42
|
-
"node": ">=14"
|
|
43
|
-
},
|
|
44
|
-
"funding": {
|
|
45
|
-
"url": "https://github.com/prettier/prettier?sponsor=1"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"dependencies": {
|
|
50
|
-
"@invisionag/prettier-config": {
|
|
51
|
-
"version": "2.1.3",
|
|
52
|
-
"resolved": "https://registry.npmjs.org/@invisionag/prettier-config/-/prettier-config-2.1.3.tgz",
|
|
53
|
-
"integrity": "sha512-/BRe7iCWtsn43hhYrD2ANla2Qf332EusDjcuuB9xOK/z3lEghp59pkuxNFIvlQ/Y9AFMaT1zOFhvxzYax+fj3g==",
|
|
54
|
-
"dev": true,
|
|
55
|
-
"requires": {}
|
|
56
|
-
},
|
|
57
|
-
"@prettier/plugin-ruby": {
|
|
58
|
-
"version": "4.0.4",
|
|
59
|
-
"resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz",
|
|
60
|
-
"integrity": "sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==",
|
|
61
|
-
"dev": true,
|
|
62
|
-
"requires": {}
|
|
63
|
-
},
|
|
64
|
-
"prettier": {
|
|
65
|
-
"version": "3.8.3",
|
|
66
|
-
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz",
|
|
67
|
-
"integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
|
|
68
|
-
"dev": true
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|