Documentation

RedisJob extends Job
in package
implements Job

Interfaces, Classes and Traits

Job

Table of Contents

$connectionName  : mixed
The name of the connection the job belongs to.
$container  : Container
The IoC container instance.
$decoded  : array<string|int, mixed>
The JSON decoded version of "$job".
$deleted  : bool
Indicates if the job has been deleted.
$failed  : bool
Indicates if the job has failed.
$instance  : mixed
The job handler instance.
$job  : string
The Redis raw job payload.
$queue  : string
The name of the queue the job belongs to.
$redis  : RedisQueue
The Redis queue instance.
$released  : bool
Indicates if the job has been released.
$reserved  : string
The Redis job payload inside the reserved queue.
__construct()  : void
Create a new job instance.
attempts()  : int
Get the number of times the job has been attempted.
delete()  : void
Delete the job from the queue.
failed()  : void
Process an exception that caused the job to fail.
fire()  : void
Fire the job.
getConnectionName()  : string
Get the name of the connection the job belongs to.
getContainer()  : Container
Get the service container instance.
getJobId()  : string
Get the job identifier.
getName()  : string
Get the name of the queued job class.
getQueue()  : string
Get the name of the queue the job belongs to.
getRawBody()  : string
Get the raw body string for the job.
getRedisQueue()  : Factory
Get the underlying Redis factory implementation.
getReservedJob()  : string
Get the underlying reserved Redis job.
hasFailed()  : bool
Determine if the job has been marked as a failure.
isDeleted()  : bool
Determine if the job has been deleted.
isDeletedOrReleased()  : bool
Determine if the job has been deleted or released.
isReleased()  : bool
Determine if the job was released back into the queue.
markAsFailed()  : void
Mark the job as "failed".
maxTries()  : int|null
Get the number of times to attempt a job.
payload()  : array<string|int, mixed>
Get the decoded body of the job.
release()  : void
Release the job back into the queue.
resolveName()  : string
Get the resolved name of the queued job class.
timeout()  : int|null
Get the number of seconds the job can run.
timeoutAt()  : int|null
Get the timestamp indicating when the job should timeout.
availableAt()  : int
Get the "available at" UNIX timestamp.
currentTime()  : int
Get the current system time as a UNIX timestamp.
parseDateInterval()  : DateTimeInterface|int
If the given value is an interval, convert it to a DateTime instance.
resolve()  : mixed
Resolve the given class.
secondsUntil()  : int
Get the number of seconds until the given DateTime.

Properties

$connectionName

The name of the connection the job belongs to.

protected mixed $connectionName

$container

The IoC container instance.

protected Container $container

$decoded

The JSON decoded version of "$job".

protected array<string|int, mixed> $decoded

$deleted

Indicates if the job has been deleted.

protected bool $deleted = false

$failed

Indicates if the job has failed.

protected bool $failed = false

$instance

The job handler instance.

protected mixed $instance

$job

The Redis raw job payload.

protected string $job

$queue

The name of the queue the job belongs to.

protected string $queue

$released

Indicates if the job has been released.

protected bool $released = false

$reserved

The Redis job payload inside the reserved queue.

protected string $reserved

Methods

__construct()

Create a new job instance.

public __construct(Container $container, RedisQueue $redis, string $job, string $reserved, string $connectionName, string $queue) : void
Parameters
$container : Container
$redis : RedisQueue
$job : string
$reserved : string
$connectionName : string
$queue : string
Return values
void

attempts()

Get the number of times the job has been attempted.

public attempts() : int
Return values
int

delete()

Delete the job from the queue.

public delete() : void
Return values
void

failed()

Process an exception that caused the job to fail.

public failed(Exception $e) : void
Parameters
$e : Exception
Return values
void

fire()

Fire the job.

public fire() : void
Return values
void

getConnectionName()

Get the name of the connection the job belongs to.

public getConnectionName() : string
Return values
string

getContainer()

Get the service container instance.

public getContainer() : Container
Return values
Container

getJobId()

Get the job identifier.

public getJobId() : string
Return values
string

getName()

Get the name of the queued job class.

public getName() : string
Return values
string

getQueue()

Get the name of the queue the job belongs to.

public getQueue() : string
Return values
string

getRawBody()

Get the raw body string for the job.

public getRawBody() : string
Return values
string

getRedisQueue()

Get the underlying Redis factory implementation.

public getRedisQueue() : Factory
Return values
Factory

getReservedJob()

Get the underlying reserved Redis job.

public getReservedJob() : string
Return values
string

hasFailed()

Determine if the job has been marked as a failure.

public hasFailed() : bool
Return values
bool

isDeleted()

Determine if the job has been deleted.

public isDeleted() : bool
Return values
bool

isDeletedOrReleased()

Determine if the job has been deleted or released.

public isDeletedOrReleased() : bool
Return values
bool

isReleased()

Determine if the job was released back into the queue.

public isReleased() : bool
Return values
bool

markAsFailed()

Mark the job as "failed".

public markAsFailed() : void
Return values
void

maxTries()

Get the number of times to attempt a job.

public maxTries() : int|null
Return values
int|null

payload()

Get the decoded body of the job.

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

release()

Release the job back into the queue.

public release(int $delay) : void
Parameters
$delay : int
Return values
void

resolveName()

Get the resolved name of the queued job class.

public resolveName() : string

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

Return values
string

timeout()

Get the number of seconds the job can run.

public timeout() : int|null
Return values
int|null

timeoutAt()

Get the timestamp indicating when the job should timeout.

public timeoutAt() : int|null
Return values
int|null

availableAt()

Get the "available at" UNIX timestamp.

protected availableAt(DateTimeInterface|DateInterval|int $delay) : int
Parameters
$delay : DateTimeInterface|DateInterval|int
Return values
int

currentTime()

Get the current system time as a UNIX timestamp.

protected currentTime() : int
Return values
int

parseDateInterval()

If the given value is an interval, convert it to a DateTime instance.

protected parseDateInterval(DateTimeInterface|DateInterval|int $delay) : DateTimeInterface|int
Parameters
$delay : DateTimeInterface|DateInterval|int
Return values
DateTimeInterface|int

resolve()

Resolve the given class.

protected resolve(string $class) : mixed
Parameters
$class : string
Return values
mixed

secondsUntil()

Get the number of seconds until the given DateTime.

protected secondsUntil(DateTimeInterface|DateInterval|int $delay) : int
Parameters
$delay : DateTimeInterface|DateInterval|int
Return values
int

Search results