Documentation

Worker
in package
implements ArrayAccess, Countable, IteratorAggregate

Queue worker 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

Interfaces

ArrayAccess
Countable
IteratorAggregate

Properties

$application  : Application|null
Application object
$queues  : array<string|int, mixed>
Queues

Methods

__construct()  : mixed
Constructor
__get()  : Queue|null
Get a queue
__isset()  : bool
Determine if a queue is registered with the worker object
__set()  : void
Register a queue with the worker
__unset()  : void
Unset a queue with the worker
addQueue()  : Worker
Add queue
addQueues()  : Worker
Add queues
application()  : Application|null
Get the application (alias)
clear()  : Worker
Clear jobs from queue
clearAll()  : Worker
Clear all jobs from queues
clearAllFailed()  : Worker
Clear all failed jobs from queues
clearAllTasks()  : Worker
Clear all tasks from queues
clearFailed()  : Worker
Clear failed jobs from queue
clearTasks()  : Worker
Clear tasks from queue
count()  : int
Return count
create()  : Worker
Create queue worker worker
getApplication()  : Application|null
Get the application
getIterator()  : ArrayIterator
Get iterator
getQueue()  : Queue|null
Get queue
getQueues()  : array<string|int, mixed>
Get queues
hasApplication()  : bool
Has application
hasQueue()  : bool
Has queue
offsetExists()  : bool
Determine if a queue is registered with the worker object
offsetGet()  : Queue|null
Get a queue
offsetSet()  : void
Set a queue with the worker
offsetUnset()  : void
Unset a queue from the worker
run()  : array<string|int, mixed>
Run next scheduled task in queue
runAll()  : array<string|int, mixed>
Run next scheduled task across in all queues
work()  : AbstractJob|null
Work next job in queue
workAll()  : array<string|int, mixed>
Work next job across in all queues

Properties

$queues

Queues

protected array<string|int, mixed> $queues = []

Methods

__construct()

Constructor

public __construct([mixed $queues = null ][, Application|null $application = null ]) : mixed

Instantiate the queue worker object.

Parameters
$queues : mixed = null
$application : Application|null = null

__get()

Get a queue

public __get(string $name) : Queue|null
Parameters
$name : string
Return values
Queue|null

__isset()

Determine if a queue is registered with the worker object

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Register a queue with the worker

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__unset()

Unset a queue with the worker

public __unset(string $name) : void
Parameters
$name : string

addQueues()

Add queues

public addQueues(array<string|int, mixed> $queues) : Worker
Parameters
$queues : array<string|int, mixed>
Return values
Worker

clear()

Clear jobs from queue

public clear(string $queueName) : Worker
Parameters
$queueName : string
Return values
Worker

clearAllFailed()

Clear all failed jobs from queues

public clearAllFailed() : Worker
Return values
Worker

clearAllTasks()

Clear all tasks from queues

public clearAllTasks() : Worker
Return values
Worker

clearFailed()

Clear failed jobs from queue

public clearFailed(string $queueName) : Worker
Parameters
$queueName : string
Return values
Worker

clearTasks()

Clear tasks from queue

public clearTasks(string $queueName) : Worker
Parameters
$queueName : string
Return values
Worker

count()

Return count

public count() : int
Return values
int

create()

Create queue worker worker

public static create([mixed $queues = null ][, Application|null $application = null ]) : Worker
Parameters
$queues : mixed = null
$application : Application|null = null
Return values
Worker

getIterator()

Get iterator

public getIterator() : ArrayIterator
Return values
ArrayIterator

getQueue()

Get queue

public getQueue(string $queue) : Queue|null
Parameters
$queue : string
Return values
Queue|null

getQueues()

Get queues

public getQueues() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasApplication()

Has application

public hasApplication() : bool
Return values
bool

hasQueue()

Has queue

public hasQueue(string $queue) : bool
Parameters
$queue : string
Return values
bool

offsetExists()

Determine if a queue is registered with the worker object

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

Get a queue

public offsetGet(mixed $offset) : Queue|null
Parameters
$offset : mixed
Return values
Queue|null

offsetSet()

Set a queue with the worker

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

Unset a queue from the worker

public offsetUnset(string $offset) : void
Parameters
$offset : string

run()

Run next scheduled task in queue

public run(string $queueName) : array<string|int, mixed>
Parameters
$queueName : string
Return values
array<string|int, mixed>

runAll()

Run next scheduled task across in all queues

public runAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

work()

Work next job in queue

public work(string $queueName) : AbstractJob|null
Parameters
$queueName : string
Return values
AbstractJob|null

workAll()

Work next job across in all queues

public workAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results