class Illuminate / Queue / Jobs / Job
You are viewing an older version of the documentation. For the latest, please visit master documentation.
abstract

Job

Uses

Properties

protected

$instance mixed

The job handler instance.

Default: null
protected

$container Container

The IoC container instance.

Default: null
protected

$deleted bool

Indicates if the job has been deleted.

Default: false
protected

$released bool

Indicates if the job has been released.

Default: false
protected

$failed bool

Indicates if the job has failed.

Default: false
protected

$connectionName string

The name of the connection the job belongs to.

Default: null
protected

$queue string

The name of the queue the job belongs to.

Default: null

Methods

public abstract

getJobId ( ) : string

Get the job identifier.

public abstract

getRawBody ( ) : string

Get the raw body of the job.

public

uuid ( ) : string|null

Get the UUID of the job.

public

fire ( ) : void

Fire the job.

public

delete ( ) : void

Delete the job from the queue.

public

isDeleted ( ) : bool

Determine if the job has been deleted.

public

release ( $delay ) : void

Release the job back into the queue.

Parameters

  • $delay int
public

isReleased ( ) : bool

Determine if the job was released back into the queue.

public

isDeletedOrReleased ( ) : bool

Determine if the job has been deleted or released.

public

hasFailed ( ) : bool

Determine if the job has been marked as a failure.

public

markAsFailed ( ) : void

Mark the job as "failed".

public

fail ( $e ) : void

Delete the job, call the "failed" method, and raise the failed job event.

Parameters

protected

failed ( $e ) : void

Process an exception that caused the job to fail.

Parameters

protected

resolve ( $class ) : mixed

Resolve the given class.

Parameters

  • $class string
public

getResolvedJob ( ) : mixed

Get the resolved job handler instance.

public

payload ( ) : array

Get the decoded body of the job.

public

maxTries ( ) : int|null

Get the number of times to attempt a job.

public

maxExceptions ( ) : int|null

Get the number of times to attempt a job after an exception.

public

shouldFailOnTimeout ( ) : bool

Determine if the job should fail when it timeouts.

public

backoff ( ) : int|null

The number of seconds to wait before retrying a job that encountered an uncaught exception.

public

timeout ( ) : int|null

Get the number of seconds the job can run.

public

retryUntil ( ) : int|null

Get the timestamp indicating when the job should timeout.

public

getName ( ) : string

Get the name of the queued job class.

public

resolveName ( ) : string

Get the resolved name of the queued job class.

public

getConnectionName ( ) : string

Get the name of the connection the job belongs to.

public

getQueue ( ) : string

Get the name of the queue the job belongs to.

public

getContainer ( ) : Container

Get the service container instance.