activejob 5.2.4 → 6.0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +125 -34
- data/MIT-LICENSE +1 -1
- data/README.md +17 -10
- data/lib/active_job.rb +2 -1
- data/lib/active_job/arguments.rb +40 -28
- data/lib/active_job/base.rb +3 -1
- data/lib/active_job/callbacks.rb +4 -1
- data/lib/active_job/core.rb +38 -21
- data/lib/active_job/enqueuing.rb +26 -5
- data/lib/active_job/exceptions.rb +40 -17
- data/lib/active_job/execution.rb +1 -1
- data/lib/active_job/gem_version.rb +4 -4
- data/lib/active_job/logging.rb +40 -9
- data/lib/active_job/queue_adapter.rb +2 -0
- data/lib/active_job/queue_adapters.rb +8 -10
- data/lib/active_job/queue_adapters/async_adapter.rb +1 -1
- data/lib/active_job/queue_adapters/backburner_adapter.rb +2 -2
- data/lib/active_job/queue_adapters/inline_adapter.rb +1 -1
- data/lib/active_job/queue_adapters/sidekiq_adapter.rb +2 -2
- data/lib/active_job/queue_adapters/test_adapter.rb +22 -8
- data/lib/active_job/queue_name.rb +21 -1
- data/lib/active_job/railtie.rb +16 -1
- data/lib/active_job/serializers.rb +63 -0
- data/lib/active_job/serializers/date_serializer.rb +21 -0
- data/lib/active_job/serializers/date_time_serializer.rb +21 -0
- data/lib/active_job/serializers/duration_serializer.rb +24 -0
- data/lib/active_job/serializers/object_serializer.rb +54 -0
- data/lib/active_job/serializers/symbol_serializer.rb +21 -0
- data/lib/active_job/serializers/time_serializer.rb +21 -0
- data/lib/active_job/serializers/time_with_zone_serializer.rb +21 -0
- data/lib/active_job/test_helper.rb +278 -57
- data/lib/active_job/timezones.rb +13 -0
- data/lib/active_job/translation.rb +1 -1
- data/lib/rails/generators/job/job_generator.rb +4 -0
- metadata +21 -10
- data/lib/active_job/queue_adapters/qu_adapter.rb +0 -46
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activejob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.0.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 6.0.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: globalid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.3.6
|
41
|
-
description: Declare job classes that can be run by a variety of
|
41
|
+
description: Declare job classes that can be run by a variety of queuing backends.
|
42
42
|
email: david@loudthinking.com
|
43
43
|
executables: []
|
44
44
|
extensions: []
|
@@ -64,7 +64,6 @@ files:
|
|
64
64
|
- lib/active_job/queue_adapters/backburner_adapter.rb
|
65
65
|
- lib/active_job/queue_adapters/delayed_job_adapter.rb
|
66
66
|
- lib/active_job/queue_adapters/inline_adapter.rb
|
67
|
-
- lib/active_job/queue_adapters/qu_adapter.rb
|
68
67
|
- lib/active_job/queue_adapters/que_adapter.rb
|
69
68
|
- lib/active_job/queue_adapters/queue_classic_adapter.rb
|
70
69
|
- lib/active_job/queue_adapters/resque_adapter.rb
|
@@ -75,19 +74,31 @@ files:
|
|
75
74
|
- lib/active_job/queue_name.rb
|
76
75
|
- lib/active_job/queue_priority.rb
|
77
76
|
- lib/active_job/railtie.rb
|
77
|
+
- lib/active_job/serializers.rb
|
78
|
+
- lib/active_job/serializers/date_serializer.rb
|
79
|
+
- lib/active_job/serializers/date_time_serializer.rb
|
80
|
+
- lib/active_job/serializers/duration_serializer.rb
|
81
|
+
- lib/active_job/serializers/object_serializer.rb
|
82
|
+
- lib/active_job/serializers/symbol_serializer.rb
|
83
|
+
- lib/active_job/serializers/time_serializer.rb
|
84
|
+
- lib/active_job/serializers/time_with_zone_serializer.rb
|
78
85
|
- lib/active_job/test_case.rb
|
79
86
|
- lib/active_job/test_helper.rb
|
87
|
+
- lib/active_job/timezones.rb
|
80
88
|
- lib/active_job/translation.rb
|
81
89
|
- lib/active_job/version.rb
|
82
90
|
- lib/rails/generators/job/job_generator.rb
|
83
91
|
- lib/rails/generators/job/templates/application_job.rb.tt
|
84
92
|
- lib/rails/generators/job/templates/job.rb.tt
|
85
|
-
homepage:
|
93
|
+
homepage: https://rubyonrails.org
|
86
94
|
licenses:
|
87
95
|
- MIT
|
88
96
|
metadata:
|
89
|
-
|
90
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
97
|
+
bug_tracker_uri: https://github.com/rails/rails/issues
|
98
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.2.1/activejob/CHANGELOG.md
|
99
|
+
documentation_uri: https://api.rubyonrails.org/v6.0.2.1/
|
100
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rubyonrails-talk
|
101
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.2.1/activejob
|
91
102
|
post_install_message:
|
92
103
|
rdoc_options: []
|
93
104
|
require_paths:
|
@@ -96,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
107
|
requirements:
|
97
108
|
- - ">="
|
98
109
|
- !ruby/object:Gem::Version
|
99
|
-
version: 2.
|
110
|
+
version: 2.5.0
|
100
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
112
|
requirements:
|
102
113
|
- - ">="
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "qu"
|
4
|
-
|
5
|
-
module ActiveJob
|
6
|
-
module QueueAdapters
|
7
|
-
# == Qu adapter for Active Job
|
8
|
-
#
|
9
|
-
# Qu is a Ruby library for queuing and processing background jobs. It is
|
10
|
-
# heavily inspired by delayed_job and Resque. Qu was created to overcome
|
11
|
-
# some shortcomings in the existing queuing libraries.
|
12
|
-
# The advantages of Qu are: Multiple backends (redis, mongo), jobs are
|
13
|
-
# requeued when worker is killed, resque-like API.
|
14
|
-
#
|
15
|
-
# Read more about Qu {here}[https://github.com/bkeepers/qu].
|
16
|
-
#
|
17
|
-
# To use Qu set the queue_adapter config to +:qu+.
|
18
|
-
#
|
19
|
-
# Rails.application.config.active_job.queue_adapter = :qu
|
20
|
-
class QuAdapter
|
21
|
-
def enqueue(job, *args) #:nodoc:
|
22
|
-
qu_job = Qu::Payload.new(klass: JobWrapper, args: [job.serialize]).tap do |payload|
|
23
|
-
payload.instance_variable_set(:@queue, job.queue_name)
|
24
|
-
end.push
|
25
|
-
|
26
|
-
# qu_job can be nil depending on the configured backend
|
27
|
-
job.provider_job_id = qu_job.id unless qu_job.nil?
|
28
|
-
qu_job
|
29
|
-
end
|
30
|
-
|
31
|
-
def enqueue_at(job, timestamp, *args) #:nodoc:
|
32
|
-
raise NotImplementedError, "This queueing backend does not support scheduling jobs. To see what features are supported go to http://api.rubyonrails.org/classes/ActiveJob/QueueAdapters.html"
|
33
|
-
end
|
34
|
-
|
35
|
-
class JobWrapper < Qu::Job #:nodoc:
|
36
|
-
def initialize(job_data)
|
37
|
-
@job_data = job_data
|
38
|
-
end
|
39
|
-
|
40
|
-
def perform
|
41
|
-
Base.execute @job_data
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|