ears 0.17.0 → 0.19.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/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +17 -0
- data/.tool-versions +1 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +60 -39
- data/lib/ears/consumer.rb +9 -3
- data/lib/ears/setup.rb +6 -1
- data/lib/ears/version.rb +1 -1
- data/package-lock.json +7 -7
- data/package.json +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffe84e09754e5329b3e82b1add44fb3222b2ac2e36c1955ad54d6ea90505df8d
|
4
|
+
data.tar.gz: 2545f546c91cdc7ba3edd73e3035bcdc3253433d7dcf9d21ab7a6b1143c8722f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24ed423d5b49a22bbab254ebd8e46322391f9d427fa0455dc039dd50fa7eb677222cef93561f11bde207fa9832c756d4050397a0dcfbb4afcb5e103fd1c82262
|
7
|
+
data.tar.gz: ffc77c61d3822b19e3e135a96983fcba0a0d61ff50b08c7a57a6e03bd5051498ac4481777e8fcccc90fc1152f4d0dc69248089e82f9ce15945be25aefd07acb9
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2025-03-10 15:51:28 UTC using RuboCop version 1.72.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: CountComments, CountAsOne.
|
11
|
+
Metrics/ClassLength:
|
12
|
+
Max: 104
|
13
|
+
|
14
|
+
# Offense count: 1
|
15
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
16
|
+
Metrics/MethodLength:
|
17
|
+
Max: 15
|
data/.tool-versions
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
ruby 3.1.6
|
2
|
-
nodejs 23.
|
2
|
+
nodejs 23.8.0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.19.0 (2025-03-10)
|
4
|
+
|
5
|
+
- Enhance Consumer#configure method and Ears.setup_consumers to accept `prefetch` option, which will be passed to Ears::Setup.
|
6
|
+
|
7
|
+
## 0.18.0 (2025-01-20)
|
8
|
+
|
9
|
+
- Enhance Consumer#configure method to accept custom queue arguments.
|
10
|
+
|
3
11
|
## 0.17.0 (2025-01-20)
|
4
12
|
|
5
13
|
- Drop support for ruby 3.0
|
data/Gemfile
CHANGED
@@ -3,12 +3,12 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :test do
|
6
|
-
gem 'prettier', require: false
|
7
6
|
gem 'rake'
|
8
7
|
gem 'rspec'
|
9
8
|
gem 'rubocop', require: false
|
10
9
|
gem 'rubocop-rake', require: false
|
11
10
|
gem 'rubocop-rspec', require: false
|
12
11
|
gem 'simplecov'
|
12
|
+
gem 'syntax_tree', require: false
|
13
13
|
gem 'yard', require: false
|
14
14
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,49 +1,39 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ears (0.
|
4
|
+
ears (0.19.0)
|
5
5
|
bunny (>= 2.22.0)
|
6
6
|
multi_json
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
amq-protocol (2.3.
|
11
|
+
amq-protocol (2.3.3)
|
12
12
|
ast (2.4.2)
|
13
13
|
bunny (2.23.0)
|
14
14
|
amq-protocol (~> 2.3, >= 2.3.1)
|
15
15
|
sorted_set (~> 1, >= 1.0.2)
|
16
|
-
diff-lcs (1.
|
16
|
+
diff-lcs (1.6.0)
|
17
17
|
docile (1.4.1)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
tilt
|
22
|
-
json (2.9.1)
|
23
|
-
language_server-protocol (3.17.0.3)
|
24
|
-
logger (1.6.5)
|
18
|
+
json (2.10.1)
|
19
|
+
language_server-protocol (3.17.0.4)
|
20
|
+
lint_roller (1.1.0)
|
25
21
|
multi_json (1.15.0)
|
26
22
|
parallel (1.26.3)
|
27
|
-
parser (3.3.
|
23
|
+
parser (3.3.7.1)
|
28
24
|
ast (~> 2.4.1)
|
29
25
|
racc
|
30
|
-
prettier (4.0.4)
|
31
|
-
syntax_tree (>= 4.0.1)
|
32
|
-
syntax_tree-haml (>= 2.0.0)
|
33
|
-
syntax_tree-rbs (>= 0.2.0)
|
34
26
|
prettier_print (1.2.1)
|
35
27
|
racc (1.8.1)
|
36
28
|
rainbow (3.1.1)
|
37
29
|
rake (13.2.1)
|
38
|
-
rbs (3.6.1)
|
39
|
-
logger
|
40
30
|
rbtree (0.4.6)
|
41
31
|
regexp_parser (2.10.0)
|
42
32
|
rspec (3.13.0)
|
43
33
|
rspec-core (~> 3.13.0)
|
44
34
|
rspec-expectations (~> 3.13.0)
|
45
35
|
rspec-mocks (~> 3.13.0)
|
46
|
-
rspec-core (3.13.
|
36
|
+
rspec-core (3.13.3)
|
47
37
|
rspec-support (~> 3.13.0)
|
48
38
|
rspec-expectations (3.13.3)
|
49
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -52,22 +42,25 @@ GEM
|
|
52
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
53
43
|
rspec-support (~> 3.13.0)
|
54
44
|
rspec-support (3.13.2)
|
55
|
-
rubocop (1.
|
45
|
+
rubocop (1.72.2)
|
56
46
|
json (~> 2.3)
|
57
|
-
language_server-protocol (
|
47
|
+
language_server-protocol (~> 3.17.0.2)
|
48
|
+
lint_roller (~> 1.1.0)
|
58
49
|
parallel (~> 1.10)
|
59
50
|
parser (>= 3.3.0.2)
|
60
51
|
rainbow (>= 2.2.2, < 4.0)
|
61
52
|
regexp_parser (>= 2.9.3, < 3.0)
|
62
|
-
rubocop-ast (>= 1.
|
53
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
63
54
|
ruby-progressbar (~> 1.7)
|
64
55
|
unicode-display_width (>= 2.4.0, < 4.0)
|
65
|
-
rubocop-ast (1.
|
56
|
+
rubocop-ast (1.38.0)
|
66
57
|
parser (>= 3.3.1.0)
|
67
|
-
rubocop-rake (0.
|
68
|
-
|
69
|
-
|
70
|
-
|
58
|
+
rubocop-rake (0.7.1)
|
59
|
+
lint_roller (~> 1.1)
|
60
|
+
rubocop (>= 1.72.1)
|
61
|
+
rubocop-rspec (3.5.0)
|
62
|
+
lint_roller (~> 1.1)
|
63
|
+
rubocop (~> 1.72, >= 1.72.1)
|
71
64
|
ruby-progressbar (1.13.0)
|
72
65
|
set (1.1.1)
|
73
66
|
simplecov (0.22.0)
|
@@ -81,17 +74,6 @@ GEM
|
|
81
74
|
set (~> 1.0)
|
82
75
|
syntax_tree (6.2.0)
|
83
76
|
prettier_print (>= 1.2.0)
|
84
|
-
syntax_tree-haml (4.0.3)
|
85
|
-
haml (>= 5.2)
|
86
|
-
prettier_print (>= 1.2.1)
|
87
|
-
syntax_tree (>= 6.0.0)
|
88
|
-
syntax_tree-rbs (1.0.0)
|
89
|
-
prettier_print
|
90
|
-
rbs
|
91
|
-
syntax_tree (>= 2.0.1)
|
92
|
-
temple (0.10.3)
|
93
|
-
thor (1.3.2)
|
94
|
-
tilt (2.6.0)
|
95
77
|
unicode-display_width (3.1.4)
|
96
78
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
97
79
|
unicode-emoji (4.0.4)
|
@@ -109,14 +91,53 @@ PLATFORMS
|
|
109
91
|
|
110
92
|
DEPENDENCIES
|
111
93
|
ears!
|
112
|
-
prettier
|
113
94
|
rake
|
114
95
|
rspec
|
115
96
|
rubocop
|
116
97
|
rubocop-rake
|
117
98
|
rubocop-rspec
|
118
99
|
simplecov
|
100
|
+
syntax_tree
|
119
101
|
yard
|
120
102
|
|
103
|
+
CHECKSUMS
|
104
|
+
amq-protocol (2.3.3) sha256=85b42738290913a35dcc487a2ca0dd260a4150b40ed1954c9c1932df466abc1f
|
105
|
+
ast (2.4.2) sha256=1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12
|
106
|
+
bunny (2.23.0) sha256=b721d18b077d111ea08eeb1934a4d5f3005ca571853c05474f31d96f7b517ada
|
107
|
+
diff-lcs (1.6.0) sha256=a1e7f7b272962f8fc769358ad00001b87cdcf32ba349d6c70c6b544613d2da2e
|
108
|
+
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
|
109
|
+
ears (0.19.0)
|
110
|
+
json (2.10.1) sha256=ddc88ad91a1baf3f0038c174f253af3b086d30dc74db17ca4259bbde982f94dc
|
111
|
+
language_server-protocol (3.17.0.4) sha256=c484626478664fd13482d8180947c50a8590484b1258b99b7aedb3b69df89669
|
112
|
+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
113
|
+
multi_json (1.15.0) sha256=1fd04138b6e4a90017e8d1b804c039031399866ff3fbabb7822aea367c78615d
|
114
|
+
parallel (1.26.3) sha256=d86babb7a2b814be9f4b81587bf0b6ce2da7d45969fab24d8ae4bf2bb4d4c7ef
|
115
|
+
parser (3.3.7.1) sha256=7dbe61618025519024ac72402a6677ead02099587a5538e84371b76659e6aca1
|
116
|
+
prettier_print (1.2.1) sha256=a72838b5f23facff21f90a5423cdcdda19e4271092b41f4ea7f50b83929e6ff9
|
117
|
+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
118
|
+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
119
|
+
rake (13.2.1) sha256=46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d
|
120
|
+
rbtree (0.4.6) sha256=14eea4469b24fd2472542e5f3eb105d6344c8ccf36f0b56d55fdcfeb4e0f10fc
|
121
|
+
regexp_parser (2.10.0) sha256=cb6f0ddde88772cd64bff1dbbf68df66d376043fe2e66a9ef77fcb1b0c548c61
|
122
|
+
rspec (3.13.0) sha256=d490914ac1d5a5a64a0e1400c1d54ddd2a501324d703b8cfe83f458337bab993
|
123
|
+
rspec-core (3.13.3) sha256=25136507f4f9cf2e8977a2851e64e438b4331646054e345998714108745cdfe4
|
124
|
+
rspec-expectations (3.13.3) sha256=0e6b5af59b900147698ea0ff80456c4f2e69cac4394fbd392fbd1ca561f66c58
|
125
|
+
rspec-mocks (3.13.2) sha256=2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef
|
126
|
+
rspec-support (3.13.2) sha256=cea3a2463fd9b84b9dcc9685efd80ea701aa8f7b3decb3b3ce795ed67737dbec
|
127
|
+
rubocop (1.72.2) sha256=0259a32d89fee60882bf4c4d8847e696357719c9db4971839da742bf053ae96b
|
128
|
+
rubocop-ast (1.38.0) sha256=4fdf6792fe443a9a18acb12dbc8225d0d64cd1654e41fedb30e79c18edbb26ae
|
129
|
+
rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
|
130
|
+
rubocop-rspec (3.5.0) sha256=710c942fe1af884ba8eea75cbb8bdbb051929a2208880a6fc2e2dce1eed5304c
|
131
|
+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
132
|
+
set (1.1.1) sha256=6c7ac6c06d5907216395a4d5dae3ffe52ca5ee8a372befe6d4dea794383f98f0
|
133
|
+
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
|
134
|
+
simplecov-html (0.13.1) sha256=5dab0b7ee612e60e9887ad57693832fdf4695b4c0c859eaea5f95c18791ef10b
|
135
|
+
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
|
136
|
+
sorted_set (1.0.3) sha256=4f2b8bee6e8c59cbd296228c0f1f81679357177a8b6859dcc2a99e86cce6372f
|
137
|
+
syntax_tree (6.2.0) sha256=a50a01c246601af3c258edbb6b12e44373d17966ab3bebd1f7224b3b994a343d
|
138
|
+
unicode-display_width (3.1.4) sha256=8caf2af1c0f2f07ec89ef9e18c7d88c2790e217c482bfc78aaa65eadd5415ac1
|
139
|
+
unicode-emoji (4.0.4) sha256=2c2c4ef7f353e5809497126285a50b23056cc6e61b64433764a35eff6c36532a
|
140
|
+
yard (0.9.37) sha256=a6e910399e78e613f80ba9add9ba7c394b1a935f083cccbef82903a3d2a26992
|
141
|
+
|
121
142
|
BUNDLED WITH
|
122
|
-
2.6.
|
143
|
+
2.6.5
|
data/lib/ears/consumer.rb
CHANGED
@@ -41,6 +41,8 @@ module Ears
|
|
41
41
|
# @option opts [Boolean] :durable_exchange (true) Whether the exchange should be durable.
|
42
42
|
# @option opts [Symbol] :exchange_type (:topic) The type of exchange to use.
|
43
43
|
# @option opts [Integer] :threads (1) The number of threads to use for this consumer.
|
44
|
+
# @option opts [Hash] :arguments (nil) Additional arguments for the queue.
|
45
|
+
# @option opts [Integer] :prefetch (1) The number of messages to prefetch.
|
44
46
|
def self.configure(opts = {})
|
45
47
|
self.queue = opts.fetch(:queue)
|
46
48
|
self.exchange = opts.fetch(:exchange)
|
@@ -49,6 +51,7 @@ module Ears
|
|
49
51
|
self.durable_exchange = opts.fetch(:durable_exchange, true)
|
50
52
|
self.exchange_type = opts.fetch(:exchange_type, :topic)
|
51
53
|
self.threads = opts.fetch(:threads, 1)
|
54
|
+
self.prefetch = opts.fetch(:prefetch, 1)
|
52
55
|
end
|
53
56
|
|
54
57
|
# The method that is called when a message from the queue is received.
|
@@ -133,7 +136,8 @@ module Ears
|
|
133
136
|
:queue_options,
|
134
137
|
:durable_exchange,
|
135
138
|
:exchange_type,
|
136
|
-
:threads
|
139
|
+
:threads,
|
140
|
+
:prefetch
|
137
141
|
|
138
142
|
private
|
139
143
|
|
@@ -143,7 +147,8 @@ module Ears
|
|
143
147
|
retry_queue: opts.fetch(:retry_queue, false),
|
144
148
|
retry_delay: opts.fetch(:retry_delay, 5000),
|
145
149
|
error_queue: opts.fetch(:error_queue, false),
|
146
|
-
|
150
|
+
arguments: opts.fetch(:arguments, nil),
|
151
|
+
}.compact
|
147
152
|
end
|
148
153
|
|
149
154
|
attr_writer :queue,
|
@@ -152,7 +157,8 @@ module Ears
|
|
152
157
|
:queue_options,
|
153
158
|
:durable_exchange,
|
154
159
|
:exchange_type,
|
155
|
-
:threads
|
160
|
+
:threads,
|
161
|
+
:prefetch
|
156
162
|
end
|
157
163
|
end
|
158
164
|
end
|
data/lib/ears/setup.rb
CHANGED
@@ -77,7 +77,12 @@ module Ears
|
|
77
77
|
configured_queue =
|
78
78
|
queue(consumer_class.queue, consumer_class.queue_options)
|
79
79
|
bind_queue_to_routing_keys(consumer_class, exchange, configured_queue)
|
80
|
-
consumer(
|
80
|
+
consumer(
|
81
|
+
configured_queue,
|
82
|
+
consumer_class,
|
83
|
+
consumer_class.threads,
|
84
|
+
{ prefetch: consumer_class.prefetch },
|
85
|
+
)
|
81
86
|
end
|
82
87
|
|
83
88
|
def bind_queue_to_routing_keys(consumer_class, exchange, configured_queue)
|
data/lib/ears/version.rb
CHANGED
data/package-lock.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"devDependencies": {
|
9
9
|
"@invisionag/prettier-config": "^2.1.3",
|
10
10
|
"@prettier/plugin-ruby": "^4.0.4",
|
11
|
-
"prettier": "^3.
|
11
|
+
"prettier": "^3.5.2"
|
12
12
|
}
|
13
13
|
},
|
14
14
|
"node_modules/@invisionag/prettier-config": {
|
@@ -30,9 +30,9 @@
|
|
30
30
|
}
|
31
31
|
},
|
32
32
|
"node_modules/prettier": {
|
33
|
-
"version": "3.
|
34
|
-
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.
|
35
|
-
"integrity": "sha512-
|
33
|
+
"version": "3.5.2",
|
34
|
+
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.2.tgz",
|
35
|
+
"integrity": "sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg==",
|
36
36
|
"dev": true,
|
37
37
|
"license": "MIT",
|
38
38
|
"bin": {
|
@@ -62,9 +62,9 @@
|
|
62
62
|
"requires": {}
|
63
63
|
},
|
64
64
|
"prettier": {
|
65
|
-
"version": "3.
|
66
|
-
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.
|
67
|
-
"integrity": "sha512-
|
65
|
+
"version": "3.5.2",
|
66
|
+
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.2.tgz",
|
67
|
+
"integrity": "sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg==",
|
68
68
|
"dev": true
|
69
69
|
}
|
70
70
|
}
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ears
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InVision AG
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- ".gitignore"
|
53
53
|
- ".rspec"
|
54
54
|
- ".rubocop.yml"
|
55
|
+
- ".rubocop_todo.yml"
|
55
56
|
- ".tool-versions"
|
56
57
|
- ".yardopts"
|
57
58
|
- CHANGELOG.md
|