class
Illuminate
/
Queue
/
Middleware
/
WithoutOverlapping
WithoutOverlapping
Uses
Properties
public
$key string
The job's unique key used for preventing overlaps.
Default: null
public
$releaseAfter DateTimeInterface |int|null
The number of seconds before a job should be available again if no lock was acquired.
Default: null
public
$expiresAfter int
The number of seconds before the lock should expire.
Default: null
public
$prefix string
The prefix of the lock key.
Default: 'laravel-queue-overlap:'
public
$shareKey bool
Share the key across different jobs.
Default: false
Methods
public
__construct ( $key , $releaseAfter , $expiresAfter ) : void
Create a new middleware instance.
Parameters
- $key string
- $releaseAfter DateTimeInterface |int|null
- $expiresAfter DateTimeInterface |int
public
handle ( $job , $next ) : mixed
Process the job.
Parameters
- $job mixed
- $next callable
public
releaseAfter ( $releaseAfter ) : $this
Set the delay (in seconds) to release the job back to the queue.
Parameters
- $releaseAfter DateTimeInterface |int
public
dontRelease ( ) : $this
Do not release the job back to the queue if no lock can be acquired.
public
expireAfter ( $expiresAfter ) : $this
Set the maximum number of seconds that can elapse before the lock is released.
Parameters
- $expiresAfter DateTimeInterface |DateInterval |int
public
withPrefix ( string $prefix ) : $this
Set the prefix of the lock key.
Parameters
- $prefix string
public
shared ( ) : $this
Indicate that the lock key should be shared across job classes.
public
getLockKey ( $job ) : string
Get the lock key for the given job.
Parameters
- $job mixed