Documentation

Database extends AbstractTaskAdapter
in package

Database 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

$db  : AbstractAdapter|null
Database adapter
$priority  : string
Queue type
$table  : string|null
Database table

Methods

__construct()  : mixed
Constructor
clear()  : Database
Clear jobs out of queue
clearFailed()  : Database
Clear failed jobs out of the queue
clearTasks()  : Database
Clear all scheduled task
create()  : Database
Create database adapter
createTable()  : Database
Create the database table
db()  : AbstractAdapter|null
Get database adapter (alias)
getDb()  : AbstractAdapter|null
Get database adapter
getEnd()  : int
Get queue length
getFailedJob()  : mixed
Get failed job from worker by job ID
getFailedJobs()  : array<string|int, mixed>
Get adapter failed jobs
getPriority()  : string
Get queue priority
getStart()  : int
Get queue length
getStatus()  : int
Get queue job status
getTable()  : string|null
Get database table
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()  : Database
Push job on to queue
removeTask()  : Database
Remove scheduled task
schedule()  : Database
Schedule job with queue
setPriority()  : AbstractAdapter
Set queue priority
updateTask()  : Database
Update scheduled task

Properties

$table

Database table

protected string|null $table = null

Methods

__construct()

Constructor

public __construct(AbstractAdapter $db[, string $table = 'pop_queue' ][, string|null $priority = null ]) : mixed

Instantiate the database adapter object

Parameters
$db : AbstractAdapter
$table : string = 'pop_queue'
$priority : string|null = null

create()

Create database adapter

public static create(AbstractAdapter $db[, string $table = 'pop_queue' ][, string|null $priority = null ]) : Database
Parameters
$db : AbstractAdapter
$table : string = 'pop_queue'
$priority : string|null = null
Return values
Database

createTable()

Create the database table

public createTable(string $table) : Database
Parameters
$table : string
Return values
Database

getEnd()

Get queue length

public getEnd() : int
Return values
int

getFailedJob()

Get failed job from worker by job ID

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>

getPriority()

Get queue priority

public getPriority() : string
Return values
string

getStart()

Get queue length

public getStart() : int
Return values
int

getStatus()

Get queue job status

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

getTable()

Get database table

public getTable() : string|null
Return values
string|null

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

removeTask()

Remove scheduled task

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

        
On this page

Search results