RedisQueue
Extends
Implements
Properties
$connection string
The connection name.
$default string
The name of the default queue.
$retryAfter int|null
The expiration time of a job.
$blockFor int|null
The maximum number of seconds to block for a job.
$migrationBatchSize int
The batch size to use when migrating delayed / expired jobs onto the primary queue.
Negative values are infinite.
Methods
__construct ( Factory $redis , $default , $connection , $retryAfter , $blockFor , $dispatchAfterCommit , $migrationBatchSize ) : void
Create a new Redis queue instance.
Parameters
- $redis Factory
- $default string
- $connection string|null
- $retryAfter int
- $blockFor int|null
- $dispatchAfterCommit bool
- $migrationBatchSize int
size ( $queue ) : int
Get the size of the queue.
Parameters
- $queue string|null
bulk ( $jobs , $data , $queue ) : void
Push an array of jobs onto the queue.
Parameters
- $jobs array
- $data mixed
- $queue string|null
push ( $job , $data , $queue ) : mixed
Push a new job onto the queue.
Parameters
- $job object|string
- $data mixed
- $queue string|null
pushRaw ( $payload , $queue , array $options ) : mixed
Push a raw payload onto the queue.
Parameters
- $payload string
- $queue string|null
- $options array
later ( $delay , $job , $data , $queue ) : mixed
Push a new job onto the queue after a delay.
Parameters
- $delay DateTimeInterface |DateInterval |int
- $job object|string
- $data mixed
- $queue string|null
laterRaw ( $delay , $payload , $queue ) : mixed
Push a raw job onto the queue after (n) seconds.
Parameters
- $delay DateTimeInterface |DateInterval |int
- $payload string
- $queue string|null
createPayloadArray ( $job , $queue , $data ) : array
Create a payload string from the given job and data.
Parameters
- $job string
- $queue string
- $data mixed
migrate ( $queue ) : void
Migrate any delayed or expired jobs onto the primary queue.
Parameters
- $queue string
migrateExpiredJobs ( $from , $to ) : array
Migrate the delayed jobs that are ready to the regular queue.
Parameters
- $from string
- $to string
- $limit int
retrieveNextJob ( $queue , $block ) : array
Retrieve the next job from the queue.
Parameters
- $queue string
- $block bool
deleteReserved ( $queue , $job ) : void
Delete a reserved job from the queue.
Parameters
- $queue string
- $job RedisJob
deleteAndRelease ( $queue , $job , $delay ) : void
Delete a reserved job from the reserved queue and release it.
Parameters
- $queue string
- $job RedisJob
- $delay int
clear ( $queue ) : int
Delete all of the jobs from the queue.
Parameters
- $queue string
getRandomId ( ) : string
Get a random ID string.
getQueue ( $queue ) : string
Get the queue or return the default.
Parameters
- $queue string|null