utopia-php/lock
A simple lock library to coordinate access to shared resources across coroutines, processes and hosts
0.3.1
73K downloads/mo
#4965 most downloaded on Packagist
utopia-php/lock
What this package is like to depend on
Last release 2 days ago
21 Aug 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 9 of 9 stable releases
Nothing withdrawn
no release was ever pulled
4 months old
9 releases · first in 2026
8 releases in the last 12 months
see the full history below
Release timeline
8 releases · Apr 2026 to Aug 2026Releases
latest 9-
0.3.121 Aug 2026 -
0.3.012 Aug 2026 -
0.2.5no date -
0.2.405 Aug 2026Release notes
Open source →- feat(lock): expose the lease token so a write can be conditional on it
- docs: centralize CODE_OF_CONDUCT and CONTRIBUTING at the monorepo root
- docs: enforce documentation style with Vale
- ci: redirect mirror issues
- ci: reuse mirror redirect workflow
-
0.2.326 Jun 2026Release notes
Open source →- refactor: apply baseline rector to packages that lacked a config
- build: hoist baseline rector + phpstan configs to the root
-
0.2.220 Jun 2026Release notes
Open source →- refactor(monorepo): simplify absorb/sync flows (-635 LoC)
- Pin all workflow actions to SHAs with ratchet, enforce in CI
-
0.2.110 Jun 2026 -
0.2.024 Apr 2026Release notes
Open source →What's New
-
Breaking: lock classes moved from
Utopia\Lock\Lock\*toUtopia\Lock\*.
Users on 0.1.0 must update imports:Utopia\Lock\Lock\Mutex→Utopia\Lock\MutexUtopia\Lock\Lock\Semaphore→Utopia\Lock\SemaphoreUtopia\Lock\Lock\File→Utopia\Lock\FileUtopia\Lock\Lock\Distributed→Utopia\Lock\Distributed
The
Utopia\Lock\Lockinterface andUtopia\Lock\Exceptionhierarchy are unchanged.
Release notes
Open source →Changed
-
Breaking: lock classes moved from
Utopia\Lock\Lock\*toUtopia\Lock\*. Users on 0.1.0 must update imports:Utopia\Lock\Lock\Mutex→Utopia\Lock\MutexUtopia\Lock\Lock\Semaphore→Utopia\Lock\SemaphoreUtopia\Lock\Lock\File→Utopia\Lock\FileUtopia\Lock\Lock\Distributed→Utopia\Lock\Distributed
The
Utopia\Lock\Lockinterface andUtopia\Lock\Exceptionhierarchy are unchanged.
-
-
0.1.024 Apr 2026Release notes
Open source →What's New
Initial release.
Utopia\Lock\Lockinterface withacquire,tryAcquire,release,withLock.Utopia\Lock\Lock\Mutex— Swoole coroutine mutex backed bySwoole\Coroutine\Channel(1).Utopia\Lock\Lock\Semaphore— Swoole coroutine semaphore with a configurable permit count.Utopia\Lock\Lock\File—flock()based file lock (LOCK_EXorLOCK_SH), cooperates with Swoole's runtime hooks.Utopia\Lock\Lock\Distributed— RedisSET NX EXlock with Lua-atomic release and refresh, fractional-second timeouts, optional logger.Utopia\Lock\Exceptionbase exception andUtopia\Lock\Exception\Contentionthrown whenwithLocktimes out.
Release notes
Open source →Initial release.
Utopia\Lock\Lockinterface withacquire,tryAcquire,release,withLock.Utopia\Lock\Lock\Mutex— Swoole coroutine mutex backed bySwoole\Coroutine\Channel(1).Utopia\Lock\Lock\Semaphore— Swoole coroutine semaphore with a configurable permit count.Utopia\Lock\Lock\File—flock()based file lock (LOCK_EXorLOCK_SH), cooperates with Swoole's runtime hooks.Utopia\Lock\Lock\Distributed— RedisSET NX EXlock with Lua-atomic release and refresh, fractional-second timeouts, optional logger.Utopia\Lock\Exceptionbase exception andUtopia\Lock\Exception\Contentionthrown whenwithLocktimes out.