Skip to content

Commit b9bc2cd

Browse files
feat: add namespace support to SemaphoreRedis and bump semaphore dependency
- Added `namespace` parameter to `SemaphoreRedis::obtainLock` for scoping locks. - Updated `charcoal-dev/semaphore` dependency to `^0.2.9` in `composer.json`.
1 parent 78ce0e1 commit b9bc2cd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"require": {
1616
"php": "^8.3",
1717
"charcoal-dev/contracts-storage": "^0.1.4",
18-
"charcoal-dev/semaphore": "^0.2.8",
18+
"charcoal-dev/semaphore": "^0.2.9",
1919
"charcoal-dev/base": "^0.2.6"
2020
},
2121
"suggest": {

src/Semaphore/SemaphoreRedis.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ public function __construct(public RedisClientInterface&LocksInterface $redisCli
2929
* @throws SemaphoreLockException
3030
*/
3131
public function obtainLock(
32-
string $lockId,
33-
?float $concurrentCheckEvery = null,
34-
int $concurrentTimeout = 0
32+
string $lockId,
33+
?float $concurrentCheckEvery = null,
34+
int $concurrentTimeout = 0,
35+
?string $namespace = null
3536
): RedisLock
3637
{
37-
return new RedisLock($this, $lockId, $concurrentCheckEvery, $concurrentTimeout);
38+
return new RedisLock($this, $lockId, $concurrentCheckEvery, $concurrentTimeout, namespace: $namespace);
3839
}
3940
}

0 commit comments

Comments
 (0)