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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e95b1aa86d2dd6d24bffa365e89a42a94b3e667da82884145503f3f40dcd27c
4
- data.tar.gz: ca709893092da51f536a6cf209b986f6e085fea9b2cd391f9d705fbc3ab7267c
3
+ metadata.gz: 4729f65b6cd35decf68be8f1850b13609d87457fa049d8914f74ade8d89f9193
4
+ data.tar.gz: 5e26c336765fbf7e73c2bdd132a2791bbf60d0191b8748f90768cb934e4a449f
5
5
  SHA512:
6
- metadata.gz: 998d63c445066bb5b913b9b652121775b620d30175b6f354cc22d071eec98f9818f6bac9ca79f1b02185da57d5401ac44327ca459e588fdbe3fc7ea293bd1e91
7
- data.tar.gz: 56eeafdb0b968a163a69b709eafaf1ca934e543eaeb45d532a4f730333bca83644f3ad808327b1c071056d9870a2cf4b0018b44849a4bd298c256002b58acd33
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: #{stats[:completed]}"
101
- puts "Failed: #{stats[:failed]}"
102
- puts "Pending: #{stats[:pending]}"
103
- puts "In-flight: #{stats[:in_flight]}"
104
- # Completed: 19
105
- # Failed: 1
106
- # Pending: 0
107
- # In-flight: 0
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Philiprehberger
4
4
  module TaskQueue
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
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.5.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-04-20 00:00:00.000000000 Z
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.