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

DatabaseQueue

Extends

Implements

Properties

protected

$database Connection

The database connection instance.

Default: null
protected

$table string

The database table that holds the jobs.

Default: null
protected

$default string

The name of the default queue.

Default: null
protected

$retryAfter int|null

The expiration time of a job.

Default: 60

Methods

public

__construct ( Connection $database , $table , $default , $retryAfter , $dispatchAfterCommit ) : void

Create a new database queue instance.

Parameters

  • $database Connection
  • $table string
  • $default string
  • $retryAfter int
  • $dispatchAfterCommit bool
public

size ( $queue ) : int

Get the size of the queue.

Parameters

  • $queue string|null
public

push ( $job , $data , $queue ) : mixed

Push a new job onto the queue.

Parameters

  • $job string
  • $data mixed
  • $queue string|null
public

pushRaw ( $payload , $queue , array $options ) : mixed

Push a raw payload onto the queue.

Parameters

  • $payload string
  • $queue string|null
  • $options array
public

later ( $delay , $job , $data , $queue ) : mixed

Push a new job onto the queue after (n) seconds.

Parameters

public

bulk ( $jobs , $data , $queue ) : mixed

Push an array of jobs onto the queue.

Parameters

  • $jobs array
  • $data mixed
  • $queue string|null
public

release ( $queue , $job , $delay ) : mixed

Release a reserved job back onto the queue after (n) seconds.

Parameters

protected

pushToDatabase ( $queue , $payload , $delay , $attempts ) : mixed

Push a raw payload to the database with a given delay of (n) seconds.

Parameters

protected

buildDatabaseRecord ( $queue , $payload , $availableAt , $attempts ) : array

Create an array to insert for the given job.

Parameters

  • $queue string|null
  • $payload string
  • $availableAt int
  • $attempts int
public

pop ( $queue ) : Job |null

Pop the next job off of the queue.

Parameters

  • $queue string|null
protected

getNextAvailableJob ( $queue ) : DatabaseJobRecord |null

Get the next available job for the queue.

Parameters

  • $queue string|null
protected

getLockForPopping ( ) : string|bool

Get the lock required for popping the next job.

protected

isAvailable ( $query ) : void

Modify the query to check for available jobs.

Parameters

protected

isReservedButExpired ( $query ) : void

Modify the query to check for jobs that are reserved but have expired.

Parameters

protected

marshalJob ( $queue , $job ) : DatabaseJob

Marshal the reserved job into a DatabaseJob instance.

Parameters

protected

markJobAsReserved ( $job ) : DatabaseJobRecord

Mark the given job ID as reserved.

Parameters

public

deleteReserved ( $queue , $id ) : void

Delete a reserved job from the queue.

Parameters

  • $queue string
  • $id string
public

deleteAndRelease ( $queue , $job , $delay ) : void

Delete a reserved job from the reserved queue and release it.

Parameters

public

clear ( $queue ) : int

Delete all of the jobs from the queue.

Parameters

  • $queue string
public

getQueue ( $queue ) : string

Get the queue or return the default.

Parameters

  • $queue string|null
public

getDatabase ( ) : Connection

Get the underlying database instance.