activejob 5.0.0.beta1.1 → 5.0.0.beta2
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.
Potentially problematic release.
This version of activejob might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -2
- data/MIT-LICENSE +1 -1
- data/lib/active_job.rb +1 -1
- data/lib/active_job/arguments.rb +2 -2
- data/lib/active_job/gem_version.rb +1 -1
- data/lib/active_job/queue_adapters.rb +1 -1
- data/lib/active_job/queue_adapters/sucker_punch_adapter.rb +17 -8
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfa4cd8e13389288d3ab4fe31be121dbc91e7611
|
4
|
+
data.tar.gz: ebb8b8ff8363f658033da88a8081d9d1541e1f7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c91edb9706c7df5606a61d015ea37efdd1c139798273055e63677716239115dc2da669a5055a3c8df7c0ba92363cd8df7bd29311c99bcd5a09f5856c36016c1e
|
7
|
+
data.tar.gz: c96357020e128cc7b7dd295bf6cfc75acf68a2da1806af609dea097ec8ff5e51b0f1663516be2bc5a587f07adc9b3e7c6258911d4ae868740a8e1e3343f6320c
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
## Rails 5.0.0.
|
1
|
+
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
2
2
|
|
3
3
|
* No changes.
|
4
4
|
|
5
5
|
|
6
|
+
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
7
|
+
|
6
8
|
* Fixed serializing `:at` option for `assert_enqueued_with`
|
7
9
|
and `assert_performed_with`.
|
8
10
|
|
@@ -31,7 +33,7 @@
|
|
31
33
|
|
32
34
|
*Jean Boussier*
|
33
35
|
|
34
|
-
* Include I18n.locale into job serialization/deserialization and use it around
|
36
|
+
* Include `I18n.locale` into job serialization/deserialization and use it around
|
35
37
|
`perform`.
|
36
38
|
|
37
39
|
Fixes #20799.
|
data/MIT-LICENSE
CHANGED
data/lib/active_job.rb
CHANGED
data/lib/active_job/arguments.rb
CHANGED
@@ -25,7 +25,7 @@ module ActiveJob
|
|
25
25
|
|
26
26
|
# Raised when an unsupported argument type is set as a job argument. We
|
27
27
|
# currently support NilClass, Fixnum, Float, String, TrueClass, FalseClass,
|
28
|
-
# Bignum and objects that can be represented as GlobalIDs (ex: Active Record).
|
28
|
+
# Bignum, BigDecimal, and objects that can be represented as GlobalIDs (ex: Active Record).
|
29
29
|
# Raised if you set the key for a Hash something else than a string or
|
30
30
|
# a symbol. Also raised when trying to serialize an object which can't be
|
31
31
|
# identified with a Global ID - such as an unpersisted Active Record model.
|
@@ -34,7 +34,7 @@ module ActiveJob
|
|
34
34
|
module Arguments
|
35
35
|
extend self
|
36
36
|
# :nodoc:
|
37
|
-
TYPE_WHITELIST = [ NilClass, Fixnum, Float, String, TrueClass, FalseClass, Bignum ]
|
37
|
+
TYPE_WHITELIST = [ NilClass, Fixnum, Float, String, TrueClass, FalseClass, Bignum, BigDecimal ]
|
38
38
|
|
39
39
|
# Serializes a set of arguments. Whitelisted types are returned
|
40
40
|
# as-is. Arrays/Hashes are serialized element by element.
|
@@ -27,7 +27,7 @@ module ActiveJob
|
|
27
27
|
# | Resque | Yes | Yes | Yes (Gem) | Queue | Global | Yes |
|
28
28
|
# | Sidekiq | Yes | Yes | Yes | Queue | No | Job |
|
29
29
|
# | Sneakers | Yes | Yes | No | Queue | Queue | No |
|
30
|
-
# | Sucker Punch | Yes | Yes |
|
30
|
+
# | Sucker Punch | Yes | Yes | Yes | No | No | No |
|
31
31
|
# | Active Job Async | Yes | Yes | Yes | No | No | No |
|
32
32
|
# | Active Job Inline | No | Yes | N/A | N/A | N/A | N/A |
|
33
33
|
#
|
@@ -5,12 +5,10 @@ module ActiveJob
|
|
5
5
|
# == Sucker Punch adapter for Active Job
|
6
6
|
#
|
7
7
|
# Sucker Punch is a single-process Ruby asynchronous processing library.
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
# a dedicated server. All queues can run within a single Rails/Sinatra
|
13
|
-
# process.
|
8
|
+
# This reduces the cost of of hosting on a service like Heroku along
|
9
|
+
# with the memory footprint of having to maintain additional jobs if
|
10
|
+
# hosting on a dedicated server. All queues can run within a
|
11
|
+
# single application (eg. Rails, Sinatra, etc.) process.
|
14
12
|
#
|
15
13
|
# Read more about Sucker Punch {here}[https://github.com/brandonhilkert/sucker_punch].
|
16
14
|
#
|
@@ -19,11 +17,22 @@ module ActiveJob
|
|
19
17
|
# Rails.application.config.active_job.queue_adapter = :sucker_punch
|
20
18
|
class SuckerPunchAdapter
|
21
19
|
def enqueue(job) #:nodoc:
|
22
|
-
JobWrapper.
|
20
|
+
if JobWrapper.respond_to?(:perform_async)
|
21
|
+
# sucker_punch 2.0 API
|
22
|
+
JobWrapper.perform_async job.serialize
|
23
|
+
else
|
24
|
+
# sucker_punch 1.0 API
|
25
|
+
JobWrapper.new.async.perform job.serialize
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
def enqueue_at(job, timestamp) #:nodoc:
|
26
|
-
|
30
|
+
if JobWrapper.respond_to?(:perform_in)
|
31
|
+
delay = timestamp - Time.current.to_f
|
32
|
+
JobWrapper.perform_in delay, job.serialize
|
33
|
+
else
|
34
|
+
raise NotImplementedError, 'sucker_punch 1.0 does not support `enqueued_at`. Please upgrade to version ~> 2.0.0 to enable this behavior.'
|
35
|
+
end
|
27
36
|
end
|
28
37
|
|
29
38
|
class JobWrapper #:nodoc:
|
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.0.0.
|
4
|
+
version: 5.0.0.beta2
|
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: 2016-01
|
11
|
+
date: 2016-02-01 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.0.0.
|
19
|
+
version: 5.0.0.beta2
|
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.0.0.
|
26
|
+
version: 5.0.0.beta2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: globalid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,8 +101,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: 1.3.1
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.5.
|
104
|
+
rubygems_version: 2.5.2
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Job framework with pluggable queues.
|
108
108
|
test_files: []
|
109
|
+
has_rdoc:
|