Documentation

Worker extends AbstractProcessor
in package

Worker class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
1.2.0

Table of Contents

FIFO  = 'FIFO'
Worker priority constants
FILO  = 'FILO'
$completed  : array<string|int, AbstractJob>
Completed jobs
$failed  : array<string|int, AbstractJob>
Failed jobs
$failedExceptions  : array<string|int, Exception>
Failed jobs exceptions
$jobs  : array<string|int, AbstractJob>
Worker jobs
$priority  : string
Worker type
$results  : array<string|int, mixed>
Job results
__construct()  : mixed
Constructor
addJob()  : Worker
Add job
addJobs()  : Worker
Add jobs
getCompletedJob()  : AbstractJob
Get completed job
getCompletedJobs()  : array<string|int, mixed>
Get completed jobs
getFailedException()  : Exception
Get failed exception
getFailedExceptions()  : array<string|int, mixed>
Get failed exceptions
getFailedJob()  : AbstractJob
Get failed job
getFailedJobs()  : array<string|int, mixed>
Get failed jobs
getJob()  : AbstractJob
Get job
getJobResult()  : mixed
Get job result
getJobResults()  : array<string|int, mixed>
Get job results
getJobs()  : array<string|int, mixed>
Get jobs
getNextIndex()  : int
Get next index
getPriority()  : string
Get worker priority
hasCompletedJobs()  : bool
Has completed jobs
hasFailedExceptions()  : bool
Has failed exceptions
hasFailedJobs()  : bool
Has failed jobs
hasJob()  : bool
Has job
hasJobResults()  : bool
Has job results
hasJobs()  : bool
Has jobs
hasNextJob()  : bool
Has next job
isFifo()  : bool
Is worker fifo
isFilo()  : bool
Is worker filo
processNext()  : int
Process next job
setPriority()  : Worker
Set worker priority

Constants

FIFO

Worker priority constants

public mixed FIFO = 'FIFO'

Properties

$failedExceptions

Failed jobs exceptions

protected array<string|int, Exception> $failedExceptions = []

$priority

Worker type

protected string $priority = 'FIFO'

Methods

__construct()

Constructor

public __construct([string $priority = 'FIFO' ]) : mixed

Instantiate the worker object

Parameters
$priority : string = 'FIFO'
Return values
mixed

addJobs()

Add jobs

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

getCompletedJobs()

Get completed jobs

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

getFailedException()

Get failed exception

public getFailedException(mixed $index) : Exception
Parameters
$index : mixed
Return values
Exception

getFailedExceptions()

Get failed exceptions

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

getFailedJobs()

Get failed jobs

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

getJobResult()

Get job result

public getJobResult(mixed $index) : mixed
Parameters
$index : mixed
Return values
mixed

getJobResults()

Get job results

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

getJobs()

Get jobs

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

getNextIndex()

Get next index

public getNextIndex() : int
Return values
int

getPriority()

Get worker priority

public getPriority() : string
Return values
string

hasCompletedJobs()

Has completed jobs

public hasCompletedJobs() : bool
Return values
bool

hasFailedExceptions()

Has failed exceptions

public hasFailedExceptions() : bool
Return values
bool

hasFailedJobs()

Has failed jobs

public hasFailedJobs() : bool
Return values
bool

hasJob()

Has job

public hasJob(int $index) : bool
Parameters
$index : int
Return values
bool

hasJobResults()

Has job results

public hasJobResults() : bool
Return values
bool

hasJobs()

Has jobs

public hasJobs() : bool
Return values
bool

hasNextJob()

Has next job

public hasNextJob() : bool
Return values
bool

isFifo()

Is worker fifo

public isFifo() : bool
Return values
bool

isFilo()

Is worker filo

public isFilo() : bool
Return values
bool

processNext()

Process next job

public processNext([Queue $queue = null ]) : int
Parameters
$queue : Queue = null
Return values
int

setPriority()

Set worker priority

public setPriority([string $priority = 'FIFO' ]) : Worker
Parameters
$priority : string = 'FIFO'
Return values
Worker

Search results