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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10e4e061222d303e5d694d816afd1d0557eb6c4e7804dd5b454e48cddcdf0797
4
- data.tar.gz: b6cdb1fcabe827988e6e8daf44d20d2da2649cf4b252d36ac68dd1f8f14db584
3
+ metadata.gz: fd735552263fe1b0d29ee266359703e365ce3e24cc5499edb73dab9092e9bc65
4
+ data.tar.gz: 98f05a4f76a8b5804ec3f4178f6f4ae488e92e293d8bbe49702709b4e67981db
5
5
  SHA512:
6
- metadata.gz: 61ab96b3ed1da09eb768ced10cbacc5cb6f4e8a8f4aead7ed57aa6f49dbdd016513dee1f1f2402a7a21504913b9ae5c0ef23298301fc398c3dcb6f224d2dcedc
7
- data.tar.gz: 011eaaabc88c46604d60c9f82727e43f6152521a7f1cb64b483a1b912eb0a047eaf8607eab31b51f31a92df90333c4130af845f10a8d7263aa3bcfd3fda85f60
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(Servus::Extensions::Async::Job)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Servus
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.0'
5
5
  end
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.2.0
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-10-22 00:00:00.000000000 Z
11
+ date: 2026-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport