Documentation

RedisQueue extends Queue
in package
implements Queue

Interfaces, Classes and Traits

Queue

Table of Contents

$connection  : string
The connection name.
$connectionName  : string
The connection name for the queue.
$container  : Container
The IoC container instance.
$default  : string
The name of the default queue.
$encrypter  : Encrypter
The encrypter implementation.
$redis  : Factory
The Redis factory implementation.
$retryAfter  : int|null
The expiration time of a job.
__construct()  : void
Create a new Redis queue instance.
bulk()  : mixed
Push an array of jobs onto the queue.
deleteAndRelease()  : void
Delete a reserved job from the reserved queue and release it.
deleteReserved()  : void
Delete a reserved job from the queue.
getConnectionName()  : string
Get the connection name for the queue.
getJobExpiration()  : mixed
Get the expiration timestamp for an object-based queue handler.
getQueue()  : string
Get the queue or return the default.
getRedis()  : Factory
Get the underlying Redis instance.
later()  : mixed
Push a new job onto the queue after a delay.
laterOn()  : mixed
Push a new job onto the queue after a delay.
migrateExpiredJobs()  : array<string|int, mixed>
Migrate the delayed jobs that are ready to the regular queue.
pop()  : Job|null
Pop the next job off of the queue.
push()  : mixed
Push a new job onto the queue.
pushOn()  : mixed
Push a new job onto the queue.
pushRaw()  : mixed
Push a raw payload onto the queue.
setConnectionName()  : $this
Set the connection name for the queue.
setContainer()  : void
Set the IoC container instance.
size()  : int
Get the size of the queue.
availableAt()  : int
Get the "available at" UNIX timestamp.
createObjectPayload()  : array<string|int, mixed>
Create a payload for an object-based queue handler.
createPayload()  : string
Create a payload string from the given job and data.
createPayloadArray()  : string
Create a payload string from the given job and data.
createStringPayload()  : array<string|int, mixed>
Create a typical, string based queue payload array.
currentTime()  : int
Get the current system time as a UNIX timestamp.
getConnection()  : Connection
Get the connection for the queue.
getDisplayName()  : string
Get the display name for the given job.
getRandomId()  : string
Get a random ID string.
laterRaw()  : mixed
Push a raw job onto the queue after a delay.
migrate()  : void
Migrate any delayed or expired jobs onto the primary queue.
parseDateInterval()  : DateTimeInterface|int
If the given value is an interval, convert it to a DateTime instance.
retrieveNextJob()  : array<string|int, mixed>
Retrieve the next job from the queue.
secondsUntil()  : int
Get the number of seconds until the given DateTime.

Properties

$connection

The connection name.

protected string $connection

$connectionName

The connection name for the queue.

protected string $connectionName

$default

The name of the default queue.

protected string $default

$retryAfter

The expiration time of a job.

protected int|null $retryAfter = 60

Methods

__construct()

Create a new Redis queue instance.

public __construct(Factory $redis[, string $default = 'default' ][, string $connection = null ][, int $retryAfter = 60 ]) : void
Parameters
$redis : Factory
$default : string = 'default'
$connection : string = null
$retryAfter : int = 60
Return values
void

bulk()

Push an array of jobs onto the queue.

public bulk(array<string|int, mixed> $jobs[, mixed $data = '' ][, string $queue = null ]) : mixed
Parameters
$jobs : array<string|int, mixed>
$data : mixed = ''
$queue : string = null
Return values
mixed

deleteAndRelease()

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

public deleteAndRelease(string $queue, RedisJob $job, int $delay) : void
Parameters
$queue : string
$job : RedisJob
$delay : int
Return values
void

deleteReserved()

Delete a reserved job from the queue.

public deleteReserved(string $queue, RedisJob $job) : void
Parameters
$queue : string
$job : RedisJob
Return values
void

getConnectionName()

Get the connection name for the queue.

public getConnectionName() : string
Return values
string

getJobExpiration()

Get the expiration timestamp for an object-based queue handler.

public getJobExpiration(mixed $job) : mixed
Parameters
$job : mixed
Return values
mixed

getQueue()

Get the queue or return the default.

public getQueue(string|null $queue) : string
Parameters
$queue : string|null
Return values
string

later()

Push a new job onto the queue after a delay.

public later(DateTimeInterface|DateInterval|int $delay, object|string $job[, mixed $data = '' ][, string $queue = null ]) : mixed
Parameters
$delay : DateTimeInterface|DateInterval|int
$job : object|string
$data : mixed = ''
$queue : string = null
Return values
mixed

laterOn()

Push a new job onto the queue after a delay.

public laterOn(string $queue, DateTimeInterface|DateInterval|int $delay, string $job[, mixed $data = '' ]) : mixed
Parameters
$queue : string
$delay : DateTimeInterface|DateInterval|int
$job : string
$data : mixed = ''
Return values
mixed

migrateExpiredJobs()

Migrate the delayed jobs that are ready to the regular queue.

public migrateExpiredJobs(string $from, string $to) : array<string|int, mixed>
Parameters
$from : string
$to : string
Return values
array<string|int, mixed>

pop()

Pop the next job off of the queue.

public pop([string $queue = null ]) : Job|null
Parameters
$queue : string = null
Return values
Job|null

push()

Push a new job onto the queue.

public push(object|string $job[, mixed $data = '' ][, string $queue = null ]) : mixed
Parameters
$job : object|string
$data : mixed = ''
$queue : string = null
Return values
mixed

pushOn()

Push a new job onto the queue.

public pushOn(string $queue, string $job[, mixed $data = '' ]) : mixed
Parameters
$queue : string
$job : string
$data : mixed = ''
Return values
mixed

pushRaw()

Push a raw payload onto the queue.

public pushRaw(string $payload[, string $queue = null ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$payload : string
$queue : string = null
$options : array<string|int, mixed> = []
Return values
mixed

setConnectionName()

Set the connection name for the queue.

public setConnectionName(string $name) : $this
Parameters
$name : string
Return values
$this

setContainer()

Set the IoC container instance.

public setContainer(Container $container) : void
Parameters
$container : Container
Return values
void

size()

Get the size of the queue.

public size([string $queue = null ]) : int
Parameters
$queue : string = null
Return values
int

availableAt()

Get the "available at" UNIX timestamp.

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

createObjectPayload()

Create a payload for an object-based queue handler.

protected createObjectPayload(mixed $job) : array<string|int, mixed>
Parameters
$job : mixed
Return values
array<string|int, mixed>

createPayload()

Create a payload string from the given job and data.

protected createPayload(string $job[, mixed $data = '' ]) : string
Parameters
$job : string
$data : mixed = ''
Tags
throws
InvalidPayloadException
Return values
string

createPayloadArray()

Create a payload string from the given job and data.

protected createPayloadArray(string $job[, mixed $data = '' ]) : string
Parameters
$job : string
$data : mixed = ''
Return values
string

createStringPayload()

Create a typical, string based queue payload array.

protected createStringPayload(string $job, mixed $data) : array<string|int, mixed>
Parameters
$job : string
$data : mixed
Return values
array<string|int, mixed>

currentTime()

Get the current system time as a UNIX timestamp.

protected currentTime() : int
Return values
int

getDisplayName()

Get the display name for the given job.

protected getDisplayName(mixed $job) : string
Parameters
$job : mixed
Return values
string

getRandomId()

Get a random ID string.

protected getRandomId() : string
Return values
string

laterRaw()

Push a raw job onto the queue after a delay.

protected laterRaw(DateTimeInterface|DateInterval|int $delay, string $payload[, string $queue = null ]) : mixed
Parameters
$delay : DateTimeInterface|DateInterval|int
$payload : string
$queue : string = null
Return values
mixed

migrate()

Migrate any delayed or expired jobs onto the primary queue.

protected migrate(string $queue) : void
Parameters
$queue : string
Return values
void

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

retrieveNextJob()

Retrieve the next job from the queue.

protected retrieveNextJob(string $queue) : array<string|int, mixed>
Parameters
$queue : string
Return values
array<string|int, 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