Arikaim CMS

QueueManager
in package
implements QueueInterface

Queue manager

Table of Contents

Interfaces

QueueInterface
Queue interface

Properties

$driver  : QueueStorageInterface|object
Queue storage driver
$jobsRegistry  : object|null
Jobs registry
$logger  : LoggerInterface|null
Logger

Methods

__construct()  : mixed
Constructor
addJob()  : bool
Add job to queue
clear()  : bool
Delete all jobs
create()  : JobInterface|null
Create job obj
createFromStorage()  : JobInterface|null
Create job instance from file in storage path
createJobFromArray()  : JobInterface|null
Create job intence from array
createWorkerManager()  : WorkerManagerInterface|null
Create worker manager
deleteJob()  : bool
Delete job
deleteJobs()  : bool
Delete jobs
executeJob()  : JobInterface|null
Execute job
getJob()  : array<string|int, mixed>|null
Find job by name, id or uuid
getJobs()  : array<string|int, mixed>|null
Get jobs
getJobsDue()  : array<string|int, mixed>|null
Get all jobs due
getNext()  : JobInterface|null
Get next job
getRecuringJobs()  : array<string|int, mixed>|null
Get recurring jobs
getStorageDriver()  : QueueStorageInterface
Get queue storage driver
has()  : bool
Return tru if job exist
jobsRegistry()  : object
Get jobs registry
push()  : bool
Push job to queue
run()  : JobInterface|null
Run job
setDriver()  : void
Set queue storage driver
updateJobParam()  : bool
Update job config param

Properties

$jobsRegistry

Jobs registry

protected object|null $jobsRegistry

Methods

addJob()

Add job to queue

public addJob(JobInterface $job[, string|null $extension = null ][, bool $disabled = false ][, string|null $recuringInterval = null ][, int|null $scheduleTime = null ][, array<string|int, mixed>|null $config = null ]) : bool
Parameters
$job : JobInterface
$extension : string|null = null
$disabled : bool = false
$recuringInterval : string|null = null
$scheduleTime : int|null = null
$config : array<string|int, mixed>|null = null
Return values
bool

clear()

Delete all jobs

public clear() : bool
Return values
bool

create()

Create job obj

public create(string $class[, array<string|int, mixed>|null $params = null ][, string|null $extension = null ]) : JobInterface|null
Parameters
$class : string

job class or name

$params : array<string|int, mixed>|null = null
$extension : string|null = null
Return values
JobInterface|null

createFromStorage()

Create job instance from file in storage path

public createFromStorage(string $storagePath[, string|null $className = null ][, array<string|int, mixed> $params = [] ]) : JobInterface|null
Parameters
$storagePath : string
$className : string|null = null
$params : array<string|int, mixed> = []
Return values
JobInterface|null

createJobFromArray()

Create job intence from array

public createJobFromArray(array<string|int, mixed> $data) : JobInterface|null
Parameters
$data : array<string|int, mixed>
Return values
JobInterface|null

createWorkerManager()

Create worker manager

public createWorkerManager([string|null $name = null ][, array<string|int, mixed>|null $args = null ]) : WorkerManagerInterface|null
Parameters
$name : string|null = null
$args : array<string|int, mixed>|null = null
Return values
WorkerManagerInterface|null

deleteJob()

Delete job

public deleteJob(string|int $id) : bool
Parameters
$id : string|int

Job id, uiid

Return values
bool

deleteJobs()

Delete jobs

public deleteJobs([array<string|int, mixed> $filter = [] ]) : bool
Parameters
$filter : array<string|int, mixed> = []
Return values
bool

executeJob()

Execute job

public executeJob(JobInterface $job[, Closure|null $onJobProgress = null ][, Closure|null $onJobProgressError = null ]) : JobInterface|null
Parameters
$job : JobInterface
$onJobProgress : Closure|null = null
$onJobProgressError : Closure|null = null
Return values
JobInterface|null

getJob()

Find job by name, id or uuid

public getJob(string|int $id) : array<string|int, mixed>|null
Parameters
$id : string|int

Job id, uiid or name

Return values
array<string|int, mixed>|null

getJobs()

Get jobs

public getJobs([array<string|int, mixed> $filter = [] ]) : array<string|int, mixed>|null
Parameters
$filter : array<string|int, mixed> = []
Return values
array<string|int, mixed>|null

getJobsDue()

Get all jobs due

public getJobsDue([string|null $jobName = null ]) : array<string|int, mixed>|null
Parameters
$jobName : string|null = null
Return values
array<string|int, mixed>|null

getRecuringJobs()

Get recurring jobs

public getRecuringJobs([string|null $extension = null ]) : array<string|int, mixed>|null
Parameters
$extension : string|null = null
Return values
array<string|int, mixed>|null

has()

Return tru if job exist

public has(mixed $id) : bool
Parameters
$id : mixed
Return values
bool

jobsRegistry()

Get jobs registry

public jobsRegistry() : object
Return values
object

push()

Push job to queue

public push(string $name[, array<string|int, mixed>|null $params = null ][, string|null $extension = null ][, string|null $recuringInterval = null ][, string|null $scheduleTime = null ]) : bool
Parameters
$name : string

job name or class

$params : array<string|int, mixed>|null = null
$extension : string|null = null

Extension package name

$recuringInterval : string|null = null
$scheduleTime : string|null = null
Return values
bool

run()

Run job

public run(JobInterface|string $name[, array<string|int, mixed>|null $params = null ][, string|null $extension = null ][, Closure|null $onJobProgress = null ][, Closure|null $onJobProgressError = null ]) : JobInterface|null
Parameters
$name : JobInterface|string

Job class, name or job instance

$params : array<string|int, mixed>|null = null

job params

$extension : string|null = null

package extension name

$onJobProgress : Closure|null = null
$onJobProgressError : Closure|null = null
Return values
JobInterface|null

updateJobParam()

Update job config param

public updateJobParam(string $id, string $key, mixed $value) : bool
Parameters
$id : string

Job id

$key : string
$value : mixed
Return values
bool

        
On this page

Search results