pgbus 1.0.0 → 1.1.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.
data/lib/pgbus/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pgbus
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -22,9 +22,17 @@ module Pgbus
22
22
 
23
23
  # Sent at once inside Pgbus.coalesce (issue #682): a step enqueue that
24
24
  # fails is reported and swept (WorkflowStep#enqueue_step_job), so it
25
- # must not become the scope's on_failure. Internal to pgbus, not an
26
- # opt-out for application jobs.
27
- def self.pgbus_coalesce? = false
25
+ # must not become the scope's on_failure. Included here as well as on
26
+ # ActiveJob::Base, so the setting holds without the engine (issue #689).
27
+ include Pgbus::ActiveJob::Coalesce::JobMixin
28
+
29
+ pgbus_coalesce false
30
+
31
+ # The adapter reads pgbus_coalesce?. Defined on this class, like
32
+ # pgbus_visibility_heartbeat_enabled above, so an app's own
33
+ # pgbus_coalesce? on ActiveJob::Base (the hook before #689) cannot
34
+ # shadow the mixin's reader; it answers what the macro set.
35
+ def self.pgbus_coalesce? = pgbus_coalesce_enabled == true
28
36
 
29
37
  def perform(step_id)
30
38
  StepExecution.new(step_id).call
@@ -43,6 +43,18 @@ module Pgbus
43
43
  end
44
44
  end
45
45
  end
46
+
47
+ module ActiveJob
48
+ class Coalesce
49
+ # `pgbus_coalesce false/true`, included on ActiveJob::Base by the engine (issue #689).
50
+ module JobMixin
51
+ module ClassMethods
52
+ def pgbus_coalesce: (?boolish enabled) -> bool
53
+ def pgbus_coalesce?: () -> bool
54
+ end
55
+ end
56
+ end
57
+ end
46
58
  end
47
59
 
48
60
  module ActiveJob
@@ -32,6 +32,8 @@ module Pgbus
32
32
  def circuit_breaker_enabled=: (untyped) -> untyped
33
33
  def coalesce_chunk_size: () -> Integer
34
34
  def coalesce_chunk_size=: (untyped) -> untyped
35
+ def coalesce_default: () -> bool
36
+ def coalesce_default=: (untyped) -> untyped
35
37
  def completed_jobs: () -> (:archive | :delete)
36
38
  def completed_jobs=: (untyped value) -> (:archive | :delete)
37
39
  def completion_batch_size: () -> Integer
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
@@ -347,6 +347,7 @@ files:
347
347
  - lib/pgbus/active_job/adapter.rb
348
348
  - lib/pgbus/active_job/batch_id.rb
349
349
  - lib/pgbus/active_job/coalesce.rb
350
+ - lib/pgbus/active_job/coalesce/job_mixin.rb
350
351
  - lib/pgbus/active_job/coalesce/middleware.rb
351
352
  - lib/pgbus/active_job/current_attributes.rb
352
353
  - lib/pgbus/active_job/delivery.rb
@@ -478,6 +479,7 @@ files:
478
479
  - lib/pgbus/pgmq_schema/pgmq_v1.12.0.sql
479
480
  - lib/pgbus/pgmq_schema/pgmq_v1.13.0.sql
480
481
  - lib/pgbus/pgmq_schema/pgmq_v1.13.1.sql
482
+ - lib/pgbus/pgmq_schema/pgmq_v1.13.2.sql
481
483
  - lib/pgbus/process/claim_buffer.rb
482
484
  - lib/pgbus/process/completer.rb
483
485
  - lib/pgbus/process/consumer.rb