async-job-adapter-active_job 0.9.0 → 0.10.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
- checksums.yaml.gz.sig +0 -0
- data/lib/async/job/adapter/active_job/dispatcher.rb +3 -3
- data/lib/async/job/adapter/active_job/executor.rb +1 -1
- data/lib/async/job/adapter/active_job/interface.rb +1 -1
- data/lib/async/job/adapter/active_job/railtie.rb +5 -5
- data/lib/async/job/adapter/active_job/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9886f60d5b9890346ead69e741f0da9a280faced6208442e0008b0d7464295c
|
4
|
+
data.tar.gz: 349d465199ec1868eb2ad419a75ca5ba7c804b5b0971e141e94ff970da227f7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6475379ef3db21705f7f2c05537f676a49f6a2c0e28200dc70840126acff35fff2b0478b51c876ef17be9f7730a1fc1d7b41b33ffa793fe9d485bf886e98e520
|
7
|
+
data.tar.gz: e82114719fe5cd8b86c5eff0cb3d0966f846de8e795c5d75a604a81e839cae88de258cf56d36035046807cca6e2adb0d8e77b6679357311536bec092c6ba65de
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -32,8 +32,8 @@ module Async
|
|
32
32
|
# @attribute [Hash(String, String)] The aliases for the definitions.
|
33
33
|
attr :aliases
|
34
34
|
|
35
|
-
#
|
36
|
-
# @parameter name [String] The name of the
|
35
|
+
# Look up a queue by name, constructing it if necessary using the given definition.
|
36
|
+
# @parameter name [String] The name of the queue.
|
37
37
|
def [](name)
|
38
38
|
@queues.fetch(name) do
|
39
39
|
definition = @definitions.fetch(name)
|
@@ -55,7 +55,7 @@ module Async
|
|
55
55
|
self[name].client.enqueue_at(job, timestamp)
|
56
56
|
end
|
57
57
|
|
58
|
-
# Start processing jobs in the given
|
58
|
+
# Start processing jobs in the given queue.
|
59
59
|
def start(name)
|
60
60
|
self[name].server.start
|
61
61
|
end
|
@@ -7,7 +7,7 @@ module Async
|
|
7
7
|
module Job
|
8
8
|
module Adapter
|
9
9
|
module ActiveJob
|
10
|
-
# An interface for `ActiveJob` that allows you to use `Async::Job` as the
|
10
|
+
# An interface for `ActiveJob` that allows you to use `Async::Job` as the queue.
|
11
11
|
class Interface
|
12
12
|
def initialize(delegate)
|
13
13
|
@delegate = delegate
|
@@ -16,9 +16,9 @@ module Async
|
|
16
16
|
module Job
|
17
17
|
module Adapter
|
18
18
|
module ActiveJob
|
19
|
-
# A Rails-specific adapter for `ActiveJob` that allows you to use `Async::Job` as the
|
19
|
+
# A Rails-specific adapter for `ActiveJob` that allows you to use `Async::Job` as the queue.
|
20
20
|
class Railtie < ::Rails::Railtie
|
21
|
-
# The default
|
21
|
+
# The default queue definition for processing jobs, using the `Inline` backend.
|
22
22
|
DEFAULT_QUEUE_DEFINITION = proc do
|
23
23
|
dequeue Processor::Inline
|
24
24
|
end
|
@@ -46,14 +46,14 @@ module Async
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
# Define an alias for a
|
49
|
+
# Define an alias for a queue.
|
50
50
|
def alias_for(name, *aliases)
|
51
51
|
aliases.each do |alias_name|
|
52
52
|
@aliases[alias_name] = name
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
# Used for dispatching jobs to a thread-local
|
56
|
+
# Used for dispatching jobs to a thread-local queue to avoid thread-safety issues.
|
57
57
|
class ThreadLocalDispatcher
|
58
58
|
def initialize(definitions, aliases)
|
59
59
|
@definitions = definitions
|
@@ -76,7 +76,7 @@ module Async
|
|
76
76
|
end
|
77
77
|
|
78
78
|
# Start processing jobs in the queue with the given name.
|
79
|
-
# @parameter name [String] The name of the
|
79
|
+
# @parameter name [String] The name of the queue.
|
80
80
|
def start(name)
|
81
81
|
dispatcher.start(name)
|
82
82
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|