async-job 0.10.1 → 0.10.2

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: d1c3279d12ab740fa116707c840e5003adf0046f3c6d61b2d91e29f60c0e1429
4
- data.tar.gz: 34751f4aadfcf4183f8123cc5396ff646be312a43e864833543a70187c94fd6f
3
+ metadata.gz: c4d685ecfe4b2bcf0a11c11303182e18d65ca7f775494d6fe7dfbd4a89618afc
4
+ data.tar.gz: 813aafc522f61f5cc4554052b022b443e05f917ae0bad490eb1aa492eeaf2293
5
5
  SHA512:
6
- metadata.gz: 88c3693057b6c972fc18922291fb8174be094edc639f44c41d6dca40b1e209e4dc78601859cef68c5a58776ea65b7a5af3003491d5bbf97cf5dfe345c5337bce
7
- data.tar.gz: 8ecbe70b32f7ead852d046e39cafd9acee5ad0e2e0edecd2dedeff4bd25b44101d0801f9f5a6a3f97cc2c89a3f6c6b43f6ce3f820ecd880941708f5d697ac3e6
6
+ metadata.gz: '08d1e3788e6b630c82b6d6597ec0601fd44794e2c956e2dee5cefc99f64e6485723e01aa4037ba322217e186d4db7773a078e724604f92b30b954b906e2a79cf'
7
+ data.tar.gz: '06279270c160d0dee2442a217af525c170f18e748203532ecf1ab43a29dfec3a0f62aea8c82b274d4d6b726be88ed799f4babad40bbceff44298759d40342a3f'
checksums.yaml.gz.sig CHANGED
Binary file
@@ -23,8 +23,14 @@ module Async
23
23
  super(delegate)
24
24
 
25
25
  @parent = parent || Async::Idler.new
26
+
27
+ @call_count = 0
28
+ @complete_count = 0
26
29
  end
27
30
 
31
+ # @attribute [Integer] The count of completed jobs.
32
+ attr_reader :complete_count
33
+
28
34
  # Process a job asynchronously with optional scheduling.
29
35
  # If the job has a scheduled_at time, the processor will wait until that time before execution.
30
36
  # @parameter job [Hash] The job data containing execution details.
@@ -36,7 +42,9 @@ module Async
36
42
  sleep(scheduled_at - Time.now)
37
43
  end
38
44
 
45
+ @call_count += 1
39
46
  @delegate.call(job)
47
+ @complete_count += 1
40
48
  rescue => error
41
49
  Console.error(self, error)
42
50
  end
@@ -51,6 +59,13 @@ module Async
51
59
  def stop
52
60
  @delegate.stop
53
61
  end
62
+
63
+ # Returns statistics about the processor's job counts.
64
+ #
65
+ # - `c`: call count / completed count.
66
+ def statistics
67
+ {c: [@call_count, @complete_count]}
68
+ end
54
69
  end
55
70
  end
56
71
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  module Async
7
7
  module Job
8
- VERSION = "0.10.1"
8
+ VERSION = "0.10.2"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -3,6 +3,8 @@
3
3
  Copyright, 2024-2025, by Samuel Williams.
4
4
  Copyright, 2024, by Alexey Ivanov.
5
5
  Copyright, 2025, by Shopify Inc.
6
+ Copyright, 2025, by Garen Torikian.
7
+ Copyright, 2025, by Luiz Carlos.
6
8
 
7
9
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
10
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -18,6 +18,10 @@ Please see the [project documentation](https://socketry.github.io/async-job/) fo
18
18
 
19
19
  Please see the [project releases](https://socketry.github.io/async-job/releases/index) for all releases.
20
20
 
21
+ ### v0.10.2
22
+
23
+ - Minor code cleanup.
24
+
21
25
  ### v0.10.1
22
26
 
23
27
  - Add release notes and modernize code.
@@ -25,7 +29,6 @@ Please see the [project releases](https://socketry.github.io/async-job/releases/
25
29
  - Improve test formatting and modernize code.
26
30
  - Achieve 100% test coverage.
27
31
  - Achieve 100% documentation coverage.
28
- - Add agent context.
29
32
 
30
33
  ### v0.10.0
31
34
 
@@ -72,12 +75,6 @@ Please see the [project releases](https://socketry.github.io/async-job/releases/
72
75
  - Add client and server example (\#3).
73
76
  - Fix gem name in guide.
74
77
 
75
- ### v0.5.0
76
-
77
- - Add benchmark example.
78
- - Add support for `Async::Idler`.
79
- - Add link to `async-job-adapter-active_job`.
80
-
81
78
  ## See Also
82
79
 
83
80
  - [async-job-processor-redis](https://github.com/socketry/async-job-processor-redis) - Redis processor for `async-job` (similar to Sidekiq).
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.10.2
4
+
5
+ - Minor code cleanup.
6
+
3
7
  ## v0.10.1
4
8
 
5
9
  - Add release notes and modernize code.
@@ -7,7 +11,6 @@
7
11
  - Improve test formatting and modernize code.
8
12
  - Achieve 100% test coverage.
9
13
  - Achieve 100% documentation coverage.
10
- - Add agent context.
11
14
 
12
15
  ## v0.10.0
13
16
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,12 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Shopify Inc.
9
9
  - Alexey Ivanov
10
+ - Garen Torikian
11
+ - Luiz Carlos
10
12
  bindir: bin
11
13
  cert_chain:
12
14
  - |
@@ -94,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
96
  - !ruby/object:Gem::Version
95
97
  version: '0'
96
98
  requirements: []
97
- rubygems_version: 3.6.7
99
+ rubygems_version: 3.6.9
98
100
  specification_version: 4
99
101
  summary: An asynchronous job queue for Ruby.
100
102
  test_files: []
metadata.gz.sig CHANGED
Binary file