philiprehberger-task_queue 0.4.0 → 0.4.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: 6a1d028dda2118c9948cbec0cdff5f7215eeb8d76615acdeaf9a2e7b5f6c45ce
4
- data.tar.gz: 94d56b9b9acb20add7a8e91dd1977f1a87a135e442dadc4c0b8acfc4eb5b5ac1
3
+ metadata.gz: 9f4e9b0ae4aaef03d903590f90278ed497bf0a4a39b76ee2a7f982d2c949e6c8
4
+ data.tar.gz: 5aa3e3eed6e165c88535e59bb7309d98e6790fbcd055faaf16ecff8daef7731e
5
5
  SHA512:
6
- metadata.gz: 4c6f850324f487d516626884c44278bce4927b2419ce9b0036dd2d1c399b41a006c2ab0d48a3f18ef60a9ebcf00ef82fbf6a70e3bc486b78cdea4c397e9dc246
7
- data.tar.gz: efb376ce60b1b9bfe43676ccefb5c0a2d03874e61d897337a6c0268555477478528583be36ab4763c5c0422b1e0fd4734db6bfa7dd738757a9e2f7616b8415f9
6
+ metadata.gz: dea4e36934d59796510506c3ece4af9bbbe1bf0307eeaa8c79fc6421f187b700b79c4b61d439e927e9720ee483f75cf0b6cedcd84e642a03a1352814efbdcacb
7
+ data.tar.gz: b7aafb9cccc93e6e753720c194300f6caa2b7407c080949fea77a985ab4d40ac3c8033535cc3485e124359bfc75ad6f1d3d6d5b40dec9cac5560f68e14c379af
data/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.2] - 2026-04-08
11
+
12
+ ### Changed
13
+ - Align gemspec summary with README description.
14
+
15
+ ## [0.4.1] - 2026-04-07
16
+
17
+ ### Added
18
+ - `Queue#empty?` to check whether any pending tasks are waiting
19
+
10
20
  ## [0.4.0] - 2026-04-05
11
21
 
12
22
  ### Added
data/README.md CHANGED
@@ -192,6 +192,7 @@ queue.shutdown(timeout: 5)
192
192
  | `#push(&block)` | `&block` — the task to execute | `self` | Enqueue a block for async execution; raises `ArgumentError` if no block given, raises `RuntimeError` if the queue is shut down |
193
193
  | `#<<(callable)` | `callable` — any object responding to `#call` | `self` | Alias for `#push`; convenient for lambdas and procs |
194
194
  | `#size` | _(none)_ | `Integer` | Number of pending (not yet started) tasks |
195
+ | `#empty?` | _(none)_ | `Boolean` | Whether there are no pending tasks waiting to be started |
195
196
  | `#running?` | _(none)_ | `Boolean` | Whether the queue is accepting new tasks |
196
197
  | `#shutdown(timeout:)` | `timeout` — seconds to wait for workers (Numeric, default `30`) | `nil` | Signal workers to stop, drain remaining tasks, join threads up to `timeout` seconds |
197
198
  | `#on_complete(&block)` | `&block` — callback receiving `(result)` | `self` | Register a callback invoked after each successful task completion with the task's return value |
@@ -146,6 +146,15 @@ module Philiprehberger
146
146
  @mutex.synchronize { @tasks.size }
147
147
  end
148
148
 
149
+ # Whether there are no pending tasks waiting to be started.
150
+ #
151
+ # In-flight tasks are not considered; use +drain+ to wait for them.
152
+ #
153
+ # @return [Boolean]
154
+ def empty?
155
+ @mutex.synchronize { @tasks.empty? }
156
+ end
157
+
149
158
  # Whether the queue is accepting new tasks.
150
159
  #
151
160
  # @return [Boolean]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Philiprehberger
4
4
  module TaskQueue
5
- VERSION = '0.4.0'
5
+ VERSION = '0.4.2'
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.4.0
4
+ version: 0.4.2
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-06 00:00:00.000000000 Z
11
+ date: 2026-04-09 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.
@@ -52,5 +52,5 @@ requirements: []
52
52
  rubygems_version: 3.5.22
53
53
  signing_key:
54
54
  specification_version: 4
55
- summary: In-process async job queue with concurrency control for Ruby
55
+ summary: In-process async job queue with concurrency control
56
56
  test_files: []