activejob 5.2.8.1 → 6.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +69 -108
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +12 -6
  5. data/lib/active_job/arguments.rb +40 -28
  6. data/lib/active_job/base.rb +3 -1
  7. data/lib/active_job/callbacks.rb +4 -1
  8. data/lib/active_job/core.rb +33 -21
  9. data/lib/active_job/enqueuing.rb +26 -5
  10. data/lib/active_job/exceptions.rb +33 -17
  11. data/lib/active_job/execution.rb +1 -1
  12. data/lib/active_job/gem_version.rb +4 -4
  13. data/lib/active_job/logging.rb +39 -8
  14. data/lib/active_job/queue_adapter.rb +2 -0
  15. data/lib/active_job/queue_adapters/async_adapter.rb +1 -1
  16. data/lib/active_job/queue_adapters/backburner_adapter.rb +2 -2
  17. data/lib/active_job/queue_adapters/inline_adapter.rb +1 -1
  18. data/lib/active_job/queue_adapters/test_adapter.rb +22 -8
  19. data/lib/active_job/queue_adapters.rb +5 -7
  20. data/lib/active_job/queue_name.rb +1 -1
  21. data/lib/active_job/railtie.rb +16 -1
  22. data/lib/active_job/serializers/date_serializer.rb +21 -0
  23. data/lib/active_job/serializers/date_time_serializer.rb +21 -0
  24. data/lib/active_job/serializers/duration_serializer.rb +24 -0
  25. data/lib/active_job/serializers/object_serializer.rb +54 -0
  26. data/lib/active_job/serializers/symbol_serializer.rb +21 -0
  27. data/lib/active_job/serializers/time_serializer.rb +21 -0
  28. data/lib/active_job/serializers/time_with_zone_serializer.rb +21 -0
  29. data/lib/active_job/serializers.rb +63 -0
  30. data/lib/active_job/test_helper.rb +262 -56
  31. data/lib/active_job/timezones.rb +13 -0
  32. data/lib/active_job/translation.rb +1 -1
  33. data/lib/active_job.rb +2 -1
  34. data/lib/rails/generators/job/job_generator.rb +4 -0
  35. metadata +23 -15
  36. 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: 5.2.8.1
4
+ version: 6.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
11
+ date: 2019-01-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: 5.2.8.1
19
+ version: 6.0.0.beta1
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: 5.2.8.1
26
+ version: 6.0.0.beta1
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 queueing backends.
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,8 +74,17 @@ 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
@@ -86,9 +94,9 @@ homepage: http://rubyonrails.org
86
94
  licenses:
87
95
  - MIT
88
96
  metadata:
89
- source_code_uri: https://github.com/rails/rails/tree/v5.2.8.1/activejob
90
- changelog_uri: https://github.com/rails/rails/blob/v5.2.8.1/activejob/CHANGELOG.md
91
- post_install_message:
97
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.0.beta1/activejob
98
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.0.beta1/activejob/CHANGELOG.md
99
+ post_install_message:
92
100
  rdoc_options: []
93
101
  require_paths:
94
102
  - lib
@@ -96,15 +104,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
104
  requirements:
97
105
  - - ">="
98
106
  - !ruby/object:Gem::Version
99
- version: 2.2.2
107
+ version: 2.5.0
100
108
  required_rubygems_version: !ruby/object:Gem::Requirement
101
109
  requirements:
102
- - - ">="
110
+ - - ">"
103
111
  - !ruby/object:Gem::Version
104
- version: '0'
112
+ version: 1.3.1
105
113
  requirements: []
106
- rubygems_version: 3.3.3
107
- signing_key:
114
+ rubygems_version: 3.0.1
115
+ signing_key:
108
116
  specification_version: 4
109
117
  summary: Job framework with pluggable queues.
110
118
  test_files: []
@@ -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