Leaf PHP

Job
in package
implements Dispatchable

AbstractYes

Table of Contents

Interfaces

Dispatchable
Contract for dispatchable classes

Properties

$connection  : string
Configured queue connection
$data  : mixed
Data to pass to the job
$delay  : mixed
Number of seconds to wait before processing a job
$delayBeforeRetry  : mixed
Number of seconds to wait before retrying a job that has failed.
$expire  : mixed
Number of seconds to wait before archiving a job that has not yet been processed
$force  : mixed
Force the worker to process the job, even if it has expired or has reached its maximum number of retries
$job  : mixed
Current job
$memory  : mixed
The maximum amount of memory the job is allowed to consume (MB)
$queue  : Queue
Queue instance
$timeout  : mixed
The number of seconds a child process can run before being killed.
$tries  : mixed
The maximum number of times the job may be attempted.

Methods

connection()  : mixed
Return configured connection
fromQueue()  : mixed
Load a job for running
getConfig()  : array<string|int, mixed>
Return config for the job
getJobId()  : string
Get the job identifier.
handleDelay()  : mixed
Handle delay for job
handleExpiry()  : mixed
Handle job expiry
hasExpired()  : mixed
Check if job has expired
hasReachedRetryLimit()  : mixed
Check if job has reached retry limit
release()  : void
Release the job back into the queue after (n) seconds.
removeFromQueue()  : mixed
retry()  : mixed
Retry job
setStatus()  : mixed
Set job status
stack()  : mixed
Return job stack if available
trigger()  : mixed
with()  : mixed
Add data to the job

Properties

$connection

Configured queue connection

protected string $connection = 'default'

$data

Data to pass to the job

protected static mixed $data = []

$delay

Number of seconds to wait before processing a job

protected mixed $delay = 0

$delayBeforeRetry

Number of seconds to wait before retrying a job that has failed.

protected mixed $delayBeforeRetry = 0

$expire

Number of seconds to wait before archiving a job that has not yet been processed

protected mixed $expire = 60

$force

Force the worker to process the job, even if it has expired or has reached its maximum number of retries

protected mixed $force = false

$job

Current job

protected mixed $job = []

$memory

The maximum amount of memory the job is allowed to consume (MB)

protected mixed $memory = 128

$queue

Queue instance

protected Queue $queue = null

$timeout

The number of seconds a child process can run before being killed.

protected mixed $timeout = 60

$tries

The maximum number of times the job may be attempted.

protected mixed $tries = 3

Methods

connection()

Return configured connection

public connection() : mixed

fromQueue()

Load a job for running

public fromQueue(mixed $job, mixed $config, mixed $queue) : mixed
Parameters
$job : mixed
$config : mixed
$queue : mixed

getConfig()

Return config for the job

public getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

getJobId()

Get the job identifier.

public getJobId() : string
Return values
string

handleDelay()

Handle delay for job

public handleDelay() : mixed

handleExpiry()

Handle job expiry

public handleExpiry() : mixed

hasExpired()

Check if job has expired

public hasExpired() : mixed

hasReachedRetryLimit()

Check if job has reached retry limit

public hasReachedRetryLimit() : mixed

release()

Release the job back into the queue after (n) seconds.

public release([int $delay = 0 ]) : void
Parameters
$delay : int = 0

removeFromQueue()

public removeFromQueue() : mixed

retry()

Retry job

public retry() : mixed

setStatus()

Set job status

public setStatus(mixed $status) : mixed
Parameters
$status : mixed

stack()

Return job stack if available

public stack() : mixed

trigger()

public trigger() : mixed

with()

Add data to the job

public static with(mixed $data) : mixed
Parameters
$data : mixed

        
On this page

Search results