async-job-adapter-active_job 0.10.0 → 0.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9886f60d5b9890346ead69e741f0da9a280faced6208442e0008b0d7464295c
4
- data.tar.gz: 349d465199ec1868eb2ad419a75ca5ba7c804b5b0971e141e94ff970da227f7f
3
+ metadata.gz: 36873f3cd52e06462bdd73217a4176fdaf7cd458f2da0316bfa69519d1bdca99
4
+ data.tar.gz: '0694a274303bad0cc146ed531cbe10358416f0e46d74a5126a40563e9813a1cc'
5
5
  SHA512:
6
- metadata.gz: 6475379ef3db21705f7f2c05537f676a49f6a2c0e28200dc70840126acff35fff2b0478b51c876ef17be9f7730a1fc1d7b41b33ffa793fe9d485bf886e98e520
7
- data.tar.gz: e82114719fe5cd8b86c5eff0cb3d0966f846de8e795c5d75a604a81e839cae88de258cf56d36035046807cca6e2adb0d8e77b6679357311536bec092c6ba65de
6
+ metadata.gz: 244e4b18674fd7cdeb6680352bf154a298c0aa7efaa24a84aa850119f54ce231878e7f91d77c98c78f6222b60610583cd7cff775f66c367f982c376712b240c3
7
+ data.tar.gz: 259a097e1931650b0d77014db832887876cc837babf99a193776b024149d6372323931be057f432f6ca141c3f16fd5c8e2ce54b72626dcafe8cda7ab0b304b55
checksums.yaml.gz.sig CHANGED
Binary file
@@ -17,8 +17,14 @@ module Async
17
17
 
18
18
  # Execute the given job.
19
19
  def call(job)
20
- # Console.debug(self, "Executing job...", id: job["job_id"])
21
- ::ActiveJob::Base.execute(job)
20
+ Console.debug(self, "Executing job...", job: job)
21
+ begin
22
+ ::ActiveJob::Base.execute(job)
23
+ rescue => error
24
+ # Error handling is done by the job itself.
25
+ # Ignore the error here, as ActiveJob has already logged unhandled errors.
26
+ # Console::Event::Failure.for(error).emit(self, "Failed to execute job!", job: job)
27
+ end
22
28
 
23
29
  @delegate&.call(job)
24
30
  end
@@ -15,14 +15,14 @@ module Async
15
15
 
16
16
  # Enqueue a job for processing.
17
17
  def enqueue(job)
18
- # Console.debug(self, "Enqueueing job...", id: job.job_id)
18
+ Console.debug(self, "Enqueueing job...", id: job.job_id)
19
19
  @delegate.call(serialize(job))
20
20
  end
21
21
 
22
22
  # Enqueue a job for processing at a specific time.
23
23
  def enqueue_at(job, timestamp)
24
24
  # We assume the given timestamp is the same as `job.scheduled_at` which is true in every case we've seen so far.
25
- # Console.debug(self, "Scheduling job...", id: job.job_id, scheduled_at: job.scheduled_at)
25
+ Console.debug(self, "Scheduling job...", id: job.job_id, scheduled_at: job.scheduled_at)
26
26
  @delegate.call(serialize(job))
27
27
  end
28
28
 
@@ -38,16 +38,16 @@ module Async
38
38
  # @parameter name [String] The name of the backend.
39
39
  # @parameter aliases [Array(String)] The aliases for the backend.
40
40
  # @parameter block [Proc] The block that defines the backend.
41
- def queue_for(name, *aliases, &block)
41
+ def define_queue(name, *aliases, &block)
42
42
  @definitions[name] = block
43
43
 
44
44
  if aliases.any?
45
- alias_for(name, *aliases)
45
+ alias_queue(name, *aliases)
46
46
  end
47
47
  end
48
48
 
49
49
  # Define an alias for a queue.
50
- def alias_for(name, *aliases)
50
+ def alias_queue(name, *aliases)
51
51
  aliases.each do |alias_name|
52
52
  @aliases[alias_name] = name
53
53
  end
@@ -7,7 +7,7 @@ module Async
7
7
  module Job
8
8
  module Adapter
9
9
  module ActiveJob
10
- VERSION = "0.10.0"
10
+ VERSION = "0.12.0"
11
11
  end
12
12
  end
13
13
  end
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.10.0
4
+ version: 0.12.0
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-08 00:00:00.000000000 Z
40
+ date: 2024-08-09 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