servus 1.2.0 → 1.3.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/lib/servus/extensions/async/call.rb +20 -1
- data/lib/servus/extensions/async/job.rb +0 -2
- data/lib/servus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fd735552263fe1b0d29ee266359703e365ce3e24cc5499edb73dab9092e9bc65
|
|
4
|
+
data.tar.gz: 98f05a4f76a8b5804ec3f4178f6f4ae488e92e293d8bbe49702709b4e67981db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b202484d40d9571bf9941b28cbb1fedd06c06fe508d26728e5698e13c8f3cd9705035e4e065d78965235f27f0a428073a410220d46bb55a4c5b2e70c0057e093
|
|
7
|
+
data.tar.gz: 7bd5c3bd0f6b54a137511941b1141e8b299ae366bcce6509a0f812261004e710de9a17b240e87a901a0cd1b38f1312fe6747be201e572780795289a4afabbdbc
|
|
@@ -175,6 +175,11 @@ module Servus
|
|
|
175
175
|
# Generates a named job subclass for this service and installs it as a sibling
|
|
176
176
|
# constant in the service's parent namespace.
|
|
177
177
|
#
|
|
178
|
+
# The job subclasses its parent service's job (see {#parent_servus_job_class}),
|
|
179
|
+
# so whatever a base service configures with {#async} — queue, priority,
|
|
180
|
+
# +retry_on+, callbacks — every service beneath it inherits, and a service's
|
|
181
|
+
# own {#async} overrides it as an ActiveJob subclass overrides its parent.
|
|
182
|
+
#
|
|
178
183
|
# The constant is +"#{ServiceConst}Job"+, so +Treasury::TransferGold::Service+
|
|
179
184
|
# yields +Treasury::TransferGold::ServiceJob+. Defining it eagerly (see
|
|
180
185
|
# {#inherited}) means Rails' production eager-load defines every service's job
|
|
@@ -191,7 +196,7 @@ module Servus
|
|
|
191
196
|
def build_servus_job_class
|
|
192
197
|
raise Servus::Events::Errors::AnonymousServiceError.for(self) if name.nil?
|
|
193
198
|
|
|
194
|
-
klass = Class.new(
|
|
199
|
+
klass = Class.new(parent_servus_job_class)
|
|
195
200
|
klass.servus_service = self
|
|
196
201
|
|
|
197
202
|
publish_job_const(servus_job_const_name, klass)
|
|
@@ -199,6 +204,20 @@ module Servus
|
|
|
199
204
|
klass
|
|
200
205
|
end
|
|
201
206
|
|
|
207
|
+
# The job class this service's job subclasses: its parent service's, so job
|
|
208
|
+
# configuration follows the service hierarchy. A service directly beneath
|
|
209
|
+
# {Servus::Base}, or beneath an anonymous service with no job of its own,
|
|
210
|
+
# starts from {Servus::Extensions::Async::Job}.
|
|
211
|
+
#
|
|
212
|
+
# @return [Class<Servus::Extensions::Async::Job>] the job class to subclass
|
|
213
|
+
# @api private
|
|
214
|
+
def parent_servus_job_class
|
|
215
|
+
parent = superclass
|
|
216
|
+
return Servus::Extensions::Async::Job unless parent < Servus::Base && parent.name
|
|
217
|
+
|
|
218
|
+
parent.servus_job_class
|
|
219
|
+
end
|
|
220
|
+
|
|
202
221
|
# @return [String] the sibling constant the service's job is published under
|
|
203
222
|
# @api private
|
|
204
223
|
def servus_job_const_name
|
|
@@ -30,8 +30,6 @@ module Servus
|
|
|
30
30
|
# @return [Class<Servus::Base>, nil] the owning service class
|
|
31
31
|
class_attribute :servus_service
|
|
32
32
|
|
|
33
|
-
queue_as :default
|
|
34
|
-
|
|
35
33
|
# Executes the job's service with the provided arguments.
|
|
36
34
|
#
|
|
37
35
|
# The service is identified by {servus_service} rather than a serialized
|
data/lib/servus/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: servus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sebastian Scholl
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|