abstract class Job

Traits

Properties

protected mixed $instance

The job handler instance.

protected Container $container

The IoC container instance.

protected bool $deleted

Indicates if the job has been deleted.

protected bool $released

Indicates if the job has been released.

protected bool $failed

Indicates if the job has failed.

protected $connectionName

The name of the connection the job belongs to.

protected string $queue

The name of the queue the job belongs to.

Methods

int
secondsUntil(DateTimeInterface $delay)

Get the number of seconds until the given DateTime.

int
availableAt(DateTimeInterface|int $delay = 0)

Get the "available at" UNIX timestamp.

int
currentTime()

Get the current system time as a UNIX timestamp.

void
fire()

Fire the job.

void
delete()

Delete the job from the queue.

bool
isDeleted()

Determine if the job has been deleted.

void
release(int $delay = 0)

Release the job back into the queue.

bool
isReleased()

Determine if the job was released back into the queue.

bool
isDeletedOrReleased()

Determine if the job has been deleted or released.

bool
hasFailed()

Determine if the job has been marked as a failure.

void
markAsFailed()

Mark the job as "failed".

void
failed(Exception $e)

Process an exception that caused the job to fail.

mixed
resolve(string $class)

Resolve the given class.

array
payload()

Get the decoded body of the job.

int|null
maxTries()

The number of times to attempt a job.

int|null
timeout()

The number of seconds the job can run.

string
getName()

Get the name of the queued job class.

string
resolveName()

Get the resolved name of the queued job class.

string
getConnectionName()

Get the name of the connection the job belongs to.

string
getQueue()

Get the name of the queue the job belongs to.

getContainer()

Get the service container instance.

Details

in InteractsWithTime at line 16
protected int secondsUntil(DateTimeInterface $delay)

Get the number of seconds until the given DateTime.

Parameters

DateTimeInterface $delay

Return Value

int

in InteractsWithTime at line 29
protected int availableAt(DateTimeInterface|int $delay = 0)

Get the "available at" UNIX timestamp.

Parameters

DateTimeInterface|int $delay

Return Value

int

in InteractsWithTime at line 41
protected int currentTime()

Get the current system time as a UNIX timestamp.

Return Value

int

at line 63
void fire()

Fire the job.

Return Value

void

at line 77
void delete()

Delete the job from the queue.

Return Value

void

at line 87
bool isDeleted()

Determine if the job has been deleted.

Return Value

bool

at line 98
void release(int $delay = 0)

Release the job back into the queue.

Parameters

int $delay

Return Value

void

at line 108
bool isReleased()

Determine if the job was released back into the queue.

Return Value

bool

at line 118
bool isDeletedOrReleased()

Determine if the job has been deleted or released.

Return Value

bool

at line 128
bool hasFailed()

Determine if the job has been marked as a failure.

Return Value

bool

at line 138
void markAsFailed()

Mark the job as "failed".

Return Value

void

at line 149
void failed(Exception $e)

Process an exception that caused the job to fail.

Parameters

Exception $e

Return Value

void

at line 168
protected mixed resolve(string $class)

Resolve the given class.

Parameters

string $class

Return Value

mixed

at line 178
array payload()

Get the decoded body of the job.

Return Value

array

at line 188
int|null maxTries()

The number of times to attempt a job.

Return Value

int|null

at line 198
int|null timeout()

The number of seconds the job can run.

Return Value

int|null

at line 208
string getName()

Get the name of the queued job class.

Return Value

string

at line 220
string resolveName()

Get the resolved name of the queued job class.

Resolves the name of "wrapped" jobs such as class-based handlers.

Return Value

string

at line 230
string getConnectionName()

Get the name of the connection the job belongs to.

Return Value

string

at line 240
string getQueue()

Get the name of the queue the job belongs to.

Return Value

string

at line 250
Container getContainer()

Get the service container instance.

Return Value

Container