async-job-adapter-active_job 0.14.0 → 0.14.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea1f70c52b6ac8fef768e6f873af46fc7d41f0fcaf2135821a85a6585289b3e5
|
4
|
+
data.tar.gz: 10961b83ada11d421f0c253f54c342323e87961a8f5718326a17323aaf7d004b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1624087283cb466494db419e184a624826b072db17782e7b69a650f4acce0ef11a4f072645b1304580f5ea4febf50f1dad3c0a632ca5c9d956241f3d905f7f1
|
7
|
+
data.tar.gz: a890ddfc103218be83e6eb954c619e21bb1991c5c16e7a58b1c061d9c19013c3c181bd75a5c453af2c6a0b6a62cffbadfd54ab1b96aede5406aa64e9e7ca7cc0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -5,6 +5,8 @@
|
|
5
5
|
|
6
6
|
require 'active_job/queue_adapters/abstract_adapter'
|
7
7
|
|
8
|
+
require 'kernel/sync'
|
9
|
+
|
8
10
|
module ActiveJob
|
9
11
|
module QueueAdapters
|
10
12
|
class AsyncJobAdapter < AbstractAdapter
|
@@ -14,12 +16,16 @@ module ActiveJob
|
|
14
16
|
|
15
17
|
# Enqueue a job for processing.
|
16
18
|
def enqueue(job)
|
17
|
-
|
19
|
+
Sync do
|
20
|
+
@dispatcher.call(job)
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
# Enqueue a job for processing at a specific time.
|
21
25
|
def enqueue_at(job, timestamp)
|
22
|
-
|
26
|
+
Sync do
|
27
|
+
@dispatcher.call(job)
|
28
|
+
end
|
23
29
|
end
|
24
30
|
end
|
25
31
|
end
|
@@ -17,7 +17,7 @@ module Async
|
|
17
17
|
# Prepare the dispacher with the given definitions and aliases.
|
18
18
|
# @parameter definitions [Hash(String, Proc)] The definitions to use constructing queues.
|
19
19
|
# @parameter aliases [Hash(String, Proc)] The aliases for the definitions.
|
20
|
-
def initialize(definitions, aliases = {})
|
20
|
+
def initialize(definitions = {}, aliases = {})
|
21
21
|
@definitions = definitions
|
22
22
|
@aliases = aliases
|
23
23
|
|
@@ -30,6 +30,9 @@ module Async
|
|
30
30
|
# @attribute [Hash(String, String)] The aliases for the definitions.
|
31
31
|
attr :aliases
|
32
32
|
|
33
|
+
# @attribute [Hash(String, Queue)] The queues that have been constructed.
|
34
|
+
attr :queues
|
35
|
+
|
33
36
|
# Look up a queue by name, constructing it if necessary using the given definition.
|
34
37
|
# @parameter name [String] The name of the queue.
|
35
38
|
def [](name)
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-job-adapter-active_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2024-08-
|
40
|
+
date: 2024-08-14 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: async-job
|
metadata.gz.sig
CHANGED
Binary file
|