philiprehberger-task_queue 0.5.0 → 0.6.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
- data/CHANGELOG.md +5 -0
- data/README.md +11 -8
- data/lib/philiprehberger/task_queue/queue.rb +3 -0
- data/lib/philiprehberger/task_queue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4729f65b6cd35decf68be8f1850b13609d87457fa049d8914f74ade8d89f9193
|
|
4
|
+
data.tar.gz: 5e26c336765fbf7e73c2bdd132a2791bbf60d0191b8748f90768cb934e4a449f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f68ed0d8be0ead8665425550efbd32d467def35234bff29875d328cabf2ab722da88789ac3a97c60b0cc29a1c299b3c015b9eea0d65ace89677592f12fd2c8d7
|
|
7
|
+
data.tar.gz: 79d4ead9724546b60ee902815899b79f573cdd6a09a1d51eb93a78dc5062355827b76b2542b1a2150db4461fa8ee459aefdf2f1374816c576fb228dd5ae41b45
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.6.0] - 2026-05-07
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- `Queue#concurrency` — read-only accessor for the maximum number of concurrent worker threads.
|
|
14
|
+
|
|
10
15
|
## [0.5.0] - 2026-04-19
|
|
11
16
|
|
|
12
17
|
### Added
|
data/README.md
CHANGED
|
@@ -97,14 +97,16 @@ queue = Philiprehberger::TaskQueue.new(concurrency: 4)
|
|
|
97
97
|
queue.drain(timeout: 10)
|
|
98
98
|
|
|
99
99
|
stats = queue.stats
|
|
100
|
-
puts "Completed:
|
|
101
|
-
puts "Failed:
|
|
102
|
-
puts "Pending:
|
|
103
|
-
puts "In-flight:
|
|
104
|
-
|
|
105
|
-
#
|
|
106
|
-
#
|
|
107
|
-
#
|
|
100
|
+
puts "Completed: #{stats[:completed]}"
|
|
101
|
+
puts "Failed: #{stats[:failed]}"
|
|
102
|
+
puts "Pending: #{stats[:pending]}"
|
|
103
|
+
puts "In-flight: #{stats[:in_flight]}"
|
|
104
|
+
puts "Concurrency: #{queue.concurrency}"
|
|
105
|
+
# Completed: 19
|
|
106
|
+
# Failed: 1
|
|
107
|
+
# Pending: 0
|
|
108
|
+
# In-flight: 0
|
|
109
|
+
# Concurrency: 4
|
|
108
110
|
```
|
|
109
111
|
|
|
110
112
|
### Pause and resume
|
|
@@ -214,6 +216,7 @@ queue.shutdown(timeout: 5)
|
|
|
214
216
|
| `#paused?` | _(none)_ | `Boolean` | Whether the queue is currently paused |
|
|
215
217
|
| `#clear` | _(none)_ | `Integer` | Remove all pending tasks and return the number cleared |
|
|
216
218
|
| `#stats_reset!` | _(none)_ | `self` | Atomically zero the `completed` and `failed` counters while leaving pending, in-flight, workers, and callbacks untouched |
|
|
219
|
+
| `#concurrency` | _(none)_ | `Integer` | Returns the configured maximum number of concurrent worker threads |
|
|
217
220
|
|
|
218
221
|
## Development
|
|
219
222
|
|
|
@@ -9,6 +9,9 @@ module Philiprehberger
|
|
|
9
9
|
# Tasks are enqueued as blocks or callable objects and executed by a pool of
|
|
10
10
|
# worker threads. The queue is fully thread-safe.
|
|
11
11
|
class Queue
|
|
12
|
+
# @return [Integer] the maximum number of concurrent worker threads
|
|
13
|
+
attr_reader :concurrency
|
|
14
|
+
|
|
12
15
|
# @param concurrency [Integer] maximum number of concurrent worker threads
|
|
13
16
|
def initialize(concurrency: 4)
|
|
14
17
|
@concurrency = concurrency
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: philiprehberger-task_queue
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Philip Rehberger
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A lightweight, zero-dependency, thread-safe in-process async job queue
|
|
14
14
|
with configurable concurrency for Ruby applications.
|