RedisJobRepository
class RedisJobRepository implements JobRepository
Traits
Constants
| DEFAULT_RECENT_JOB_RETENTION |
|
| DEFAULT_FAILED_JOB_RETENTION |
|
| DEFAULT_MONITORED_JOB_RETENTION |
|
Properties
| array | $keys | The keys stored on the job hashes. |
|
| int | $recentFailedJobExpires | The number of minutes until recently failed jobs should be purged. |
|
| int | $recentJobExpires | The number of minutes until recent jobs should be purged. |
|
| int | $pendingJobExpires | The number of minutes until pending jobs should be purged. |
|
| int | $completedJobExpires | The number of minutes until completed and silenced jobs should be purged. |
|
| int | $failedJobExpires | The number of minutes until failed jobs should be purged. |
|
| int | $monitoredJobExpires | The number of minutes until monitored jobs should be purged. |
Methods
Execute commands in a pipeline, falling back to a transaction.
Get the next job ID that should be assigned.
Get the total count of recent jobs.
Get the total count of failed jobs.
Get a chunk of recent jobs.
Get a chunk of failed jobs.
Get a chunk of pending jobs.
Get a chunk of completed jobs.
Get a chunk of silenced jobs.
Get the count of recent jobs.
Get the count of failed jobs.
Get the count of pending jobs.
Get the count of completed jobs.
Get the count of silenced jobs.
Get the count of the recently failed jobs.
Get a chunk of jobs from the given type set.
Get the number of jobs in a given type set.
Get the number of minutes to count for a given type set.
Retrieve the jobs with the given IDs.
Mark the job as released / pending.
Mark the job as completed and monitored.
Mark the given jobs as released / pending.
Handle the storage of a completed job.
Update the retry status of a job's parent.
Update the retry status of a job in a retry array.
Delete the given monitored jobs by IDs.
Trim the recent job list.
Trim the failed job list.
Trim the monitored job list.
Find a failed job by ID.
Mark the job as failed.
Store the look-up references for a job.
Remove the look-up references for a job.
Store the retry job ID on the original job record.
Delete a failed job by ID.
Delete pending and reserved jobs for a queue, optionally on one connection.
Get the Redis connection instance.
Details
in
UsesClusterAwarePipeline at line 12
protected array
pipeline(callable $callback)
Execute commands in a pipeline, falling back to a transaction.
at line 70
__construct(Factory $redis)
Create a new repository instance.
at line 84
string
nextJobId()
Get the next job ID that should be assigned.
at line 92
int
totalRecent()
Get the total count of recent jobs.
at line 100
int
totalFailed()
Get the total count of failed jobs.
at line 108
Collection
getRecent(int|null $afterIndex = null)
Get a chunk of recent jobs.
at line 116
Collection
getFailed(int|null $afterIndex = null)
Get a chunk of failed jobs.
at line 124
Collection
getPending(int|null $afterIndex = null)
Get a chunk of pending jobs.
at line 132
Collection
getCompleted(int|null $afterIndex = null)
Get a chunk of completed jobs.
at line 140
Collection
getSilenced(int|null $afterIndex = null)
Get a chunk of silenced jobs.
at line 148
int
countRecent()
Get the count of recent jobs.
at line 156
int
countFailed()
Get the count of failed jobs.
at line 164
int
countPending()
Get the count of pending jobs.
at line 172
int
countCompleted()
Get the count of completed jobs.
at line 180
int
countSilenced()
Get the count of silenced jobs.
at line 188
int
countRecentlyFailed()
Get the count of the recently failed jobs.
at line 196
protected Collection
getJobsByType(string $type, int|null $afterIndex)
Get a chunk of jobs from the given type set.
at line 210
protected int
countJobsByType(string $type)
Get the number of jobs in a given type set.
at line 224
protected int
minutesForType(string $type)
Get the number of minutes to count for a given type set.
at line 239
Collection
getJobs(array $ids, mixed $indexFrom = 0)
Retrieve the jobs with the given IDs.
at line 257
protected Collection
indexJobs(Collection $jobs, int $indexFrom)
Index the given jobs from the given index.
at line 273
void
pushed(string $connection, string $queue, JobPayload $payload)
Insert the job into storage.
at line 302
void
reserved(string $connection, string $queue, JobPayload $payload)
Mark the job as reserved.
at line 320
void
released(string $connection, string $queue, JobPayload $payload, int $delay = 0)
Mark the job as released / pending.
at line 336
void
remember(string $connection, string $queue, JobPayload $payload)
Mark the job as completed and monitored.
at line 364
void
migrated(string $connection, string $queue, Collection $payloads)
Mark the given jobs as released / pending.
at line 384
void
completed(JobPayload $payload, bool $failed = false, bool $silenced = false)
Handle the storage of a completed job.
at line 409
protected void
updateRetryInformationOnParent(JobPayload $payload, bool $failed)
Update the retry status of a job's parent.
at line 429
protected array
updateRetryStatus(JobPayload $payload, array $retries, bool $failed)
Update the retry status of a job in a retry array.
at line 441
void
deleteMonitored(array $ids)
Delete the given monitored jobs by IDs.
at line 453
void
trimRecentJobs()
Trim the recent job list.
at line 492
void
trimFailedJobs()
Trim the failed job list.
at line 504
void
trimMonitoredJobs()
Trim the monitored job list.
at line 516
stdClass|null
findFailed(string $id)
Find a failed job by ID.
at line 537
void
failed(Throwable $exception, string $connection, string $queue, JobPayload $payload)
Mark the job as failed.
at line 573
protected void
storeJobReference(mixed $pipe, string $key, JobPayload $payload)
Store the look-up references for a job.
at line 581
protected void
removeJobReference(mixed $pipe, string $key, JobPayload $payload)
Remove the look-up references for a job.
at line 589
void
storeRetryReference(string $id, string $retryId)
Store the retry job ID on the original job record.
at line 605
int
deleteFailed(string $id)
Delete a failed job by ID.
at line 615
int
purge(string $queue, string|null $connection = null)
Delete pending and reserved jobs for a queue, optionally on one connection.
at line 642
protected RedisProxy
connection()
Get the Redis connection instance.