activejob 8.0.3 → 8.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +74 -31
- data/README.md +7 -5
- data/lib/active_job/arguments.rb +47 -44
- data/lib/active_job/base.rb +3 -4
- data/lib/active_job/configured_job.rb +6 -1
- data/lib/active_job/continuable.rb +102 -0
- data/lib/active_job/continuation/step.rb +83 -0
- data/lib/active_job/continuation/test_helper.rb +89 -0
- data/lib/active_job/continuation/validation.rb +50 -0
- data/lib/active_job/continuation.rb +332 -0
- data/lib/active_job/core.rb +11 -1
- data/lib/active_job/enqueue_after_transaction_commit.rb +1 -26
- data/lib/active_job/enqueuing.rb +8 -4
- data/lib/active_job/exceptions.rb +17 -8
- data/lib/active_job/execution_state.rb +11 -0
- data/lib/active_job/gem_version.rb +2 -2
- data/lib/active_job/instrumentation.rb +12 -12
- data/lib/active_job/log_subscriber.rb +61 -6
- data/lib/active_job/queue_adapters/abstract_adapter.rb +6 -0
- data/lib/active_job/queue_adapters/async_adapter.rb +5 -1
- data/lib/active_job/queue_adapters/sidekiq_adapter.rb +19 -0
- data/lib/active_job/queue_adapters/test_adapter.rb +5 -1
- data/lib/active_job/railtie.rb +9 -19
- data/lib/active_job/serializers/action_controller_parameters_serializer.rb +25 -0
- data/lib/active_job/serializers/big_decimal_serializer.rb +3 -4
- data/lib/active_job/serializers/date_serializer.rb +3 -4
- data/lib/active_job/serializers/date_time_serializer.rb +3 -4
- data/lib/active_job/serializers/duration_serializer.rb +5 -6
- data/lib/active_job/serializers/module_serializer.rb +3 -4
- data/lib/active_job/serializers/object_serializer.rb +11 -14
- data/lib/active_job/serializers/range_serializer.rb +9 -9
- data/lib/active_job/serializers/symbol_serializer.rb +4 -5
- data/lib/active_job/serializers/time_serializer.rb +3 -4
- data/lib/active_job/serializers/time_with_zone_serializer.rb +3 -4
- data/lib/active_job/serializers.rb +54 -15
- data/lib/active_job/structured_event_subscriber.rb +220 -0
- data/lib/active_job.rb +3 -0
- metadata +14 -9
- data/lib/active_job/queue_adapters/sucker_punch_adapter.rb +0 -56
- data/lib/active_job/timezones.rb +0 -13
- data/lib/active_job/translation.rb +0 -13
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activejob
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.0
|
|
4
|
+
version: 8.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 8.0
|
|
18
|
+
version: 8.1.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 8.0
|
|
25
|
+
version: 8.1.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: globalid
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -51,12 +51,18 @@ files:
|
|
|
51
51
|
- lib/active_job/base.rb
|
|
52
52
|
- lib/active_job/callbacks.rb
|
|
53
53
|
- lib/active_job/configured_job.rb
|
|
54
|
+
- lib/active_job/continuable.rb
|
|
55
|
+
- lib/active_job/continuation.rb
|
|
56
|
+
- lib/active_job/continuation/step.rb
|
|
57
|
+
- lib/active_job/continuation/test_helper.rb
|
|
58
|
+
- lib/active_job/continuation/validation.rb
|
|
54
59
|
- lib/active_job/core.rb
|
|
55
60
|
- lib/active_job/deprecator.rb
|
|
56
61
|
- lib/active_job/enqueue_after_transaction_commit.rb
|
|
57
62
|
- lib/active_job/enqueuing.rb
|
|
58
63
|
- lib/active_job/exceptions.rb
|
|
59
64
|
- lib/active_job/execution.rb
|
|
65
|
+
- lib/active_job/execution_state.rb
|
|
60
66
|
- lib/active_job/gem_version.rb
|
|
61
67
|
- lib/active_job/instrumentation.rb
|
|
62
68
|
- lib/active_job/log_subscriber.rb
|
|
@@ -72,12 +78,12 @@ files:
|
|
|
72
78
|
- lib/active_job/queue_adapters/resque_adapter.rb
|
|
73
79
|
- lib/active_job/queue_adapters/sidekiq_adapter.rb
|
|
74
80
|
- lib/active_job/queue_adapters/sneakers_adapter.rb
|
|
75
|
-
- lib/active_job/queue_adapters/sucker_punch_adapter.rb
|
|
76
81
|
- lib/active_job/queue_adapters/test_adapter.rb
|
|
77
82
|
- lib/active_job/queue_name.rb
|
|
78
83
|
- lib/active_job/queue_priority.rb
|
|
79
84
|
- lib/active_job/railtie.rb
|
|
80
85
|
- lib/active_job/serializers.rb
|
|
86
|
+
- lib/active_job/serializers/action_controller_parameters_serializer.rb
|
|
81
87
|
- lib/active_job/serializers/big_decimal_serializer.rb
|
|
82
88
|
- lib/active_job/serializers/date_serializer.rb
|
|
83
89
|
- lib/active_job/serializers/date_time_serializer.rb
|
|
@@ -89,10 +95,9 @@ files:
|
|
|
89
95
|
- lib/active_job/serializers/time_object_serializer.rb
|
|
90
96
|
- lib/active_job/serializers/time_serializer.rb
|
|
91
97
|
- lib/active_job/serializers/time_with_zone_serializer.rb
|
|
98
|
+
- lib/active_job/structured_event_subscriber.rb
|
|
92
99
|
- lib/active_job/test_case.rb
|
|
93
100
|
- lib/active_job/test_helper.rb
|
|
94
|
-
- lib/active_job/timezones.rb
|
|
95
|
-
- lib/active_job/translation.rb
|
|
96
101
|
- lib/active_job/version.rb
|
|
97
102
|
- lib/rails/generators/job/USAGE
|
|
98
103
|
- lib/rails/generators/job/job_generator.rb
|
|
@@ -103,10 +108,10 @@ licenses:
|
|
|
103
108
|
- MIT
|
|
104
109
|
metadata:
|
|
105
110
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
106
|
-
changelog_uri: https://github.com/rails/rails/blob/v8.0
|
|
107
|
-
documentation_uri: https://api.rubyonrails.org/v8.0
|
|
111
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.1.0/activejob/CHANGELOG.md
|
|
112
|
+
documentation_uri: https://api.rubyonrails.org/v8.1.0/
|
|
108
113
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
109
|
-
source_code_uri: https://github.com/rails/rails/tree/v8.0
|
|
114
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.1.0/activejob
|
|
110
115
|
rubygems_mfa_required: 'true'
|
|
111
116
|
rdoc_options: []
|
|
112
117
|
require_paths:
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "sucker_punch"
|
|
4
|
-
|
|
5
|
-
module ActiveJob
|
|
6
|
-
module QueueAdapters
|
|
7
|
-
# = Sucker Punch adapter for Active Job
|
|
8
|
-
#
|
|
9
|
-
# Sucker Punch is a single-process Ruby asynchronous processing library.
|
|
10
|
-
# This reduces the cost of hosting on a service like Heroku along
|
|
11
|
-
# with the memory footprint of having to maintain additional jobs if
|
|
12
|
-
# hosting on a dedicated server. All queues can run within a
|
|
13
|
-
# single application (e.g. \Rails, Sinatra, etc.) process.
|
|
14
|
-
#
|
|
15
|
-
# Read more about Sucker Punch {here}[https://github.com/brandonhilkert/sucker_punch].
|
|
16
|
-
#
|
|
17
|
-
# To use Sucker Punch set the queue_adapter config to +:sucker_punch+.
|
|
18
|
-
#
|
|
19
|
-
# Rails.application.config.active_job.queue_adapter = :sucker_punch
|
|
20
|
-
class SuckerPunchAdapter < AbstractAdapter
|
|
21
|
-
def check_adapter
|
|
22
|
-
ActiveJob.deprecator.warn <<~MSG.squish
|
|
23
|
-
The `sucker_punch` adapter is deprecated and will be removed in Rails 8.1.
|
|
24
|
-
Please use the `async` adapter instead.
|
|
25
|
-
MSG
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def enqueue(job) # :nodoc:
|
|
29
|
-
if JobWrapper.respond_to?(:perform_async)
|
|
30
|
-
# sucker_punch 2.0 API
|
|
31
|
-
JobWrapper.perform_async job.serialize
|
|
32
|
-
else
|
|
33
|
-
# sucker_punch 1.0 API
|
|
34
|
-
JobWrapper.new.async.perform job.serialize
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def enqueue_at(job, timestamp) # :nodoc:
|
|
39
|
-
if JobWrapper.respond_to?(:perform_in)
|
|
40
|
-
delay = timestamp - Time.current.to_f
|
|
41
|
-
JobWrapper.perform_in delay, job.serialize
|
|
42
|
-
else
|
|
43
|
-
raise NotImplementedError, "sucker_punch 1.0 does not support `enqueue_at`. Please upgrade to version ~> 2.0.0 to enable this behavior."
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
class JobWrapper # :nodoc:
|
|
48
|
-
include SuckerPunch::Job
|
|
49
|
-
|
|
50
|
-
def perform(job_data)
|
|
51
|
-
Base.execute job_data
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
data/lib/active_job/timezones.rb
DELETED