Tags: utopia-php/lock
Tags
feat: initial release with Mutex, Semaphore, File and Distributed locks Four lock primitives behind a single `Utopia\Lock\Lock` interface: - Mutex and Semaphore built on Swoole\Coroutine\Channel. - File lock using flock(), cooperates with Swoole runtime hooks. - Distributed lock using Redis SET NX EX with Lua-atomic release. Port of the internal cloud Redis distributed lock, rewritten around a fractional-second deadline so short timeouts are actually honoured instead of blocking for 10s per retry. `withLock()` always releases, even on exception, and throws `Utopia\Lock\Exception\Contention` on acquire timeout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>