Documentation

Redis extends AbstractTaskAdapter
in package

Redis adapter class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
2.1.0

Table of Contents

Properties

$prefix  : string
Queue prefix
$priority  : string
Queue type
$redis  : Redis|null
Redis object

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'

$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
throws
Exception|RedisException

clearFailed()

Clear failed jobs out of the queue

public clearFailed() : Redis
Return values
Redis

clearTasks()

Clear all scheduled task

public clearTasks() : Redis
Return values
Redis

create()

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
throws
Exception|RedisException
Return values
Redis

getEnd()

Get queue length

public getEnd() : int
Return values
int

getFailedJob()

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
string

getPriority()

Get queue priority

public getPriority() : string
Return values
string

getRedis()

Get Redis object

public getRedis() : Redis|null
Return values
Redis|null

getStart()

Get queue start index

public getStart() : int
Return values
int

getStatus()

Get queue job status

public getStatus(int $index) : int
Parameters
$index : int
Return values
int

getTask()

Get scheduled task

public getTask(string $taskId) : Task|null
Parameters
$taskId : string
Return values
Task|null

getTaskCount()

Get scheduled tasks count

public getTaskCount() : int
Return values
int

getTasks()

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
bool

hasFailedJobs()

Check if adapter has failed jobs

public hasFailedJobs() : bool
Return values
bool

hasJobs()

Check if adapter has jobs

public hasJobs() : bool
Return values
bool

hasTasks()

Has scheduled tasks

public hasTasks() : bool
Return values
bool

isLifo()

Is LIFO (alias to FILO)

public isLifo() : bool
Return values
bool

isLilo()

Is LILO (alias to FIFO)

public isLilo() : bool
Return values
bool

redis()

Get Redis object (alias)

public redis() : Redis|null
Return values
Redis|null

removeTask()

Remove scheduled task

public removeTask(string $taskId) : Redis
Parameters
$taskId : string
Return values
Redis

updateTask()

Update scheduled task

public updateTask(Task $task) : Redis
Parameters
$task : Task
Return values
Redis

        
On this page

Search results