ConcurrencyLimiter
class ConcurrencyLimiter (View source)
Properties
| protected LockProvider | $store | The cache store instance. |
|
| protected string | $name | The name of the limiter. |
|
| protected int | $maxLocks | The allowed number of concurrent locks. |
|
| protected int | $releaseAfter | The number of seconds a slot should be maintained. |
Methods
__construct(LockProvider $store, string $name, int $maxLocks, int $releaseAfter)
Create a new concurrency limiter instance.
mixed
block(int $timeout, callable|null $callback = null, int $sleep = 250)
Attempt to acquire the lock for the given number of seconds.
Details
__construct(LockProvider $store, string $name, int $maxLocks, int $releaseAfter)
Create a new concurrency limiter instance.
mixed
block(int $timeout, callable|null $callback = null, int $sleep = 250)
Attempt to acquire the lock for the given number of seconds.
protected Lock|false
acquire(string $id)
Attempt to acquire a slot lock.
protected void
release(Lock $lock)
Release the lock.