async-job 0.9.0 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7381f7520a5ee41df3c93fc4f55c647952f10066868fcb22a196fb6ee807a1dd
4
- data.tar.gz: a063193f2ff8a71fe798aadc3ce07d392fd2c53cadd5523cb20813fff9da2bdc
3
+ metadata.gz: eeb1fabbd3ce8f2806c1b3c3c4fc5c81c0f661e92d49f29a26ed5dac46960ab9
4
+ data.tar.gz: 4187e3a56169deffce40590a9ebda6e075ec66f0450e8808cb5af6bc2ab7ce13
5
5
  SHA512:
6
- metadata.gz: 56f1a056d2cbc2dab6a97226c07b6d2acec56de40bd95c302b652e4689c3fa08986a7b6f4e4c53a0ca15555c61695da6ef2219f8585d1c1006c01cacfffac50b
7
- data.tar.gz: b0c62cf9b609beee163c948ff9fc933a1d82b3f0f611e555ddc4dadd4909ab3e0791e474ae7cdf35cb1081d12d38a5f73f37148945e2658bec07af31388b8480
6
+ metadata.gz: 5d1ef79240e7ee4928675166a2e4ebf608910b559401aefb7eba8088edb47fa50a08b7a784dadb4b23708627c53d1275b2559fb70ed1a2e13387680dde14fbe2
7
+ data.tar.gz: 5bbdefdc4c753d464a30f548f8a1d91f350f54d92248732de0e9c4bca012bda8422c803cea0c4547b708804b354677d18bb5df76c29fc42744a537fcb1f32e94
checksums.yaml.gz.sig CHANGED
Binary file
@@ -73,7 +73,6 @@ module Async
73
73
  end
74
74
 
75
75
  def complete(id)
76
- # Console.debug(self, "Completing job: #{id}")
77
76
  @client.evalsha(@complete, 2, @pending_key, @job_store.key, id)
78
77
  end
79
78
 
@@ -91,7 +90,7 @@ module Async
91
90
  uptime = (Time.now.to_f - start_time).round(2)
92
91
  @client.set(heartbeat_key, JSON.dump(uptime: uptime), seconds: delay*factor)
93
92
 
94
- # REQUEUE any jobs that have been abandoned:
93
+ # Requeue any jobs that have been abandoned:
95
94
  count = @client.evalsha(@requeue, 2, @key, @ready_list.key)
96
95
  if count > 0
97
96
  Console.warn(self, "Requeued #{count} abandoned jobs.")
@@ -81,6 +81,11 @@ module Async
81
81
 
82
82
  protected
83
83
 
84
+ # Dequeue a job from the ready list and process it.
85
+ #
86
+ # If the job fails for any reason, it will be retried.
87
+ #
88
+ # If you do not desire this behavior, you should catch exceptions in the delegate.
84
89
  def dequeue(parent)
85
90
  _id = @processing_list.fetch
86
91
 
@@ -91,8 +96,8 @@ module Async
91
96
  @delegate.call(job)
92
97
  @processing_list.complete(id)
93
98
  rescue => error
99
+ Console::Event::Failure.for(error).emit(self, "Job failed with error!", id: id)
94
100
  @processing_list.retry(id)
95
- Console.error(self, error)
96
101
  end
97
102
  ensure
98
103
  @processing_list.retry(_id) if _id
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Job
8
- VERSION = "0.9.0"
8
+ VERSION = "0.9.2"
9
9
  end
10
10
  end
data/lib/async/job.rb CHANGED
@@ -6,3 +6,4 @@
6
6
  require_relative 'job/version'
7
7
  require_relative 'job/queue'
8
8
  require_relative 'job/builder'
9
+ require_relative 'job/buffer'
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -38,7 +38,7 @@ cert_chain:
38
38
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
39
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
40
  -----END CERTIFICATE-----
41
- date: 2024-08-08 00:00:00.000000000 Z
41
+ date: 2024-08-09 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: async
metadata.gz.sig CHANGED
Binary file