Counted locks (semaphores) — #37, closes #36
resource_claim accepts an optional capacity (1-64, default 1): up to N sessions can hold a slot on the same resource concurrently. Useful to throttle CPU-heavy workloads across parallel sessions (#35):
resource_claim { resource: "cpu-heavy", capacity: 3, wait: true }
- The capacity takes effect when the resource goes from free to held; joiners inherit it and it cannot change while any slot is held.
- One waiter is notified per freed slot (release, per-slot expiry, force-release, which now clears every slot).
capacity: 1keeps the exact exclusive-lock behavior of previous versions.- On-disk databases are migrated automatically on first open.
Note: v0.3.0 (lock waiting queue, targeted session cleanup, inbox threading, CLI dashboard and watch mode, same-branch warning) was tagged on GitHub but never published to npm; npm users upgrading from 0.2.3 get both releases' changes at once. See the v0.3.0 release notes for details.
Full changelog: v0.3.0...v0.4.0