class
Illuminate
/
Redis
/
Limiters
/
ConcurrencyLimiter
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
ConcurrencyLimiter
Properties
protected
$name string
The name of the limiter.
Default: null
protected
$maxLocks int
The allowed number of concurrent tasks.
Default: null
protected
$releaseAfter int
The number of seconds a slot should be maintained.
Default: null
Methods
public
__construct ( $redis , $name , $maxLocks , $releaseAfter ) : void
Create a new concurrency limiter instance.
Parameters
- $redis Connection
- $name string
- $maxLocks int
- $releaseAfter int
public
block ( $timeout , $callback , $sleep ) : mixed
Attempt to acquire the lock for the given number of seconds.
Parameters
- $timeout int
- $callback callable|null
- $sleep int
protected
acquire ( $id ) : mixed
Attempt to acquire the lock.
Parameters
-
$id
string
A unique identifier for this lock
protected
lockScript ( ) : string
Get the Lua script for acquiring a lock.
protected
release ( $key , $id ) : void
Release the lock.
Parameters
- $key string
- $id string
protected
releaseScript ( ) : string
Get the Lua script to atomically release a lock.