Redis
extends AbstractTaskAdapter
in package
Redis adapter class
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor
- clear() : Redis
- Clear jobs out of queue
- clearFailed() : Redis
- Clear failed jobs out of the queue
- clearTasks() : Redis
- Clear all scheduled task
- create() : Redis
- Create Redis adapter
- getEnd() : int
- Get queue length
- getFailedJob() : mixed
- Get failed job
- getFailedJobs() : array<string|int, mixed>
- Get adapter failed jobs
- getPrefix() : string
- Get prefix
- getPriority() : string
- Get queue priority
- getRedis() : Redis|null
- Get Redis object
- getStart() : int
- Get queue start index
- getStatus() : int
- Get queue job status
- getTask() : Task|null
- Get scheduled task
- getTaskCount() : int
- Get scheduled tasks count
- getTasks() : array<string|int, mixed>
- Get scheduled tasks
- hasFailedJob() : bool
- Check if adapter has failed job
- hasFailedJobs() : bool
- Check if adapter has failed jobs
- hasJobs() : bool
- Check if adapter has jobs
- hasTasks() : bool
- Has scheduled tasks
- isFifo() : bool
- Is FIFO
- isFilo() : bool
- Is FILO
- isLifo() : bool
- Is LIFO (alias to FILO)
- isLilo() : bool
- Is LILO (alias to FIFO)
- pop() : AbstractJob|null
- Pop job off of queue
- push() : Redis
- Push job on to queue
- redis() : Redis|null
- Get Redis object (alias)
- removeTask() : Redis
- Remove scheduled task
- schedule() : Redis
- Push job on to queue
- setPriority() : AbstractAdapter
- Set queue priority
- updateTask() : Redis
- Update scheduled task
Properties
$prefix
Queue prefix
protected
string
$prefix
= 'pop-queue'
$priority
Queue type
protected
string
$priority
= 'FIFO'
$redis
Redis object
protected
Redis|null
$redis
= null
Methods
__construct()
Constructor
public
__construct([string $host = 'localhost' ][, int|string $port = 6379 ][, string $prefix = 'pop-queue' ][, string|null $priority = null ]) : mixed
Instantiate the redis adapter
Parameters
- $host : string = 'localhost'
- $port : int|string = 6379
- $prefix : string = 'pop-queue'
- $priority : string|null = null
Tags
clear()
Clear jobs out of queue
public
clear() : Redis
Return values
RedisclearFailed()
Clear failed jobs out of the queue
public
clearFailed() : Redis
Return values
RedisclearTasks()
Clear all scheduled task
public
clearTasks() : Redis
Return values
Rediscreate()
Create Redis adapter
public
static create([string $host = 'localhost' ][, int|string $port = 6379 ][, string $prefix = 'pop-queue' ][, string|null $priority = null ]) : Redis
Parameters
- $host : string = 'localhost'
- $port : int|string = 6379
- $prefix : string = 'pop-queue'
- $priority : string|null = null
Tags
Return values
RedisgetEnd()
Get queue length
public
getEnd() : int
Return values
intgetFailedJob()
Get failed job
public
getFailedJob(int $index[, bool $unserialize = true ]) : mixed
Parameters
- $index : int
- $unserialize : bool = true
getFailedJobs()
Get adapter failed jobs
public
getFailedJobs([bool $unserialize = true ]) : array<string|int, mixed>
Parameters
- $unserialize : bool = true
Return values
array<string|int, mixed>getPrefix()
Get prefix
public
getPrefix() : string
Return values
stringgetPriority()
Get queue priority
public
getPriority() : string
Return values
stringgetRedis()
Get Redis object
public
getRedis() : Redis|null
Return values
Redis|nullgetStart()
Get queue start index
public
getStart() : int
Return values
intgetStatus()
Get queue job status
public
getStatus(int $index) : int
Parameters
- $index : int
Return values
intgetTask()
Get scheduled task
public
getTask(string $taskId) : Task|null
Parameters
- $taskId : string
Return values
Task|nullgetTaskCount()
Get scheduled tasks count
public
getTaskCount() : int
Return values
intgetTasks()
Get scheduled tasks
public
getTasks() : array<string|int, mixed>
Return values
array<string|int, mixed>hasFailedJob()
Check if adapter has failed job
public
hasFailedJob(int $index) : bool
Parameters
- $index : int
Return values
boolhasFailedJobs()
Check if adapter has failed jobs
public
hasFailedJobs() : bool
Return values
boolhasJobs()
Check if adapter has jobs
public
hasJobs() : bool
Return values
boolhasTasks()
Has scheduled tasks
public
hasTasks() : bool
Return values
boolisFifo()
Is FIFO
public
isFifo() : bool
Return values
boolisFilo()
Is FILO
public
isFilo() : bool
Return values
boolisLifo()
Is LIFO (alias to FILO)
public
isLifo() : bool
Return values
boolisLilo()
Is LILO (alias to FIFO)
public
isLilo() : bool
Return values
boolpop()
Pop job off of queue
public
pop() : AbstractJob|null
Return values
AbstractJob|nullpush()
Push job on to queue
public
push(AbstractJob $job) : Redis
Parameters
- $job : AbstractJob
Return values
Redisredis()
Get Redis object (alias)
public
redis() : Redis|null
Return values
Redis|nullremoveTask()
Remove scheduled task
public
removeTask(string $taskId) : Redis
Parameters
- $taskId : string
Return values
Redisschedule()
Push job on to queue
public
schedule(Task $task) : Redis
Parameters
- $task : Task
Return values
RedissetPriority()
Set queue priority
public
setPriority([string $priority = 'FIFO' ]) : AbstractAdapter
Parameters
- $priority : string = 'FIFO'
Return values
AbstractAdapterupdateTask()
Update scheduled task
public
updateTask(Task $task) : Redis
Parameters
- $task : Task