class
Illuminate
/
Redis
/
Limiters
/
ConcurrencyLimiterBuilder
ConcurrencyLimiterBuilder
Uses
Properties
public
$name string
The name of the lock.
Default: null
public
$maxLocks int
The maximum number of entities that can hold the lock at the same time.
Default: null
public
$releaseAfter int
The number of seconds to maintain the lock until it is automatically released.
Default: 60
public
$timeout int
The amount of time to block until a lock is available.
Default: 3
public
$sleep int
The number of milliseconds to wait between attempts to acquire the lock.
Default: 250
Methods
public
__construct ( $connection , $name ) : void
Create a new builder instance.
Parameters
- $connection Connection
- $name string
public
limit ( $maxLocks ) : $this
Set the maximum number of locks that can be obtained per time window.
Parameters
- $maxLocks int
public
releaseAfter ( $releaseAfter ) : $this
Set the number of seconds until the lock will be released.
Parameters
- $releaseAfter int
public
block ( $timeout ) : $this
Set the amount of time to block until a lock is available.
Parameters
- $timeout int
public
sleep ( $sleep ) : $this
The number of milliseconds to wait between lock acquisition attempts.
Parameters
- $sleep int
public
then ( callable $callback , callable $failure ) : mixed
Execute the given callback if a lock is obtained, otherwise call the failure callback.
Parameters
- $callback callable
- $failure callable|null