class Illuminate / Queue / Middleware / WithoutOverlapping
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

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

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

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

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