PHP Класс Queue\Model\Table\QueuedJobsTable

Наследование: extends Cake\ORM\Table
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$findMethods array
$rateHistory array

Защищенные свойства (Protected)

Свойство Тип Описание
$_key string | null

Открытые методы

Метод Описание
cleanOldJobs ( ) : void Cleanup/Delete Completed Jobs.
clearDoublettes ( ) : void FIXME
clearKey ( ) : void Resets worker Identifier
createJob ( string $jobName, array $data = null, array $config = [] ) : Cake\ORM\Entity Add a new Job to the Queue.
getLength ( string | null $type = null ) : integer Returns the number of items in the queue.
getPendingStats ( ) : array Return some statistics about unfinished jobs still in the Database.
getStats ( ) : array Return some statistics about finished jobs still in the Database.
getTypes ( ) : array Return a list of all job types in the Queue.
initConfig ( ) : void
initialize ( array $config ) : void initialize Table
key ( ) : string Generates a unique Identifier for the current worker thread.
lastRun ( ) : array
markJobDone ( Queue\Model\Entity\QueuedJob $job ) : boolean Mark a job as Completed, removing it from the queue.
markJobFailed ( Queue\Model\Entity\QueuedJob $job, string | null $failureMessage = null ) : boolean Mark a job as Failed, incrementing the failed-counter and Requeueing it.
requestJob ( array $capabilities, string | null $group = null ) : Queue\Model\Entity\QueuedJob | null Look for a new job that can be processed with the current abilities and from the specified group (or any if null).
reset ( ) : boolean Reset current jobs
truncate ( ) : void truncate()
updateProgress ( integer $id, float $progress ) : boolean

Защищенные методы

Метод Описание
_findProgress ( string $state, array $query = [], array $results = [] ) : array Custom find method, as in `find('progress', .

Описание методов

_findProgress() защищенный Метод

..)`.
protected _findProgress ( string $state, array $query = [], array $results = [] ) : array
$state string Current state
$query array Parameters
$results array Results
Результат array Query/Results based on state

cleanOldJobs() публичный Метод

Cleanup/Delete Completed Jobs.
public cleanOldJobs ( ) : void
Результат void

clearDoublettes() публичный Метод

FIXME
public clearDoublettes ( ) : void
Результат void

clearKey() публичный Метод

Resets worker Identifier
public clearKey ( ) : void
Результат void

createJob() публичный Метод

Config - priority: 1-10, defaults to 5 - notBefore: Optional date which must not be preceded - group: Used to group similar QueuedJobs - reference: An optional reference string
public createJob ( string $jobName, array $data = null, array $config = [] ) : Cake\ORM\Entity
$jobName string Job name
$data array Array of data
$config array Config to save along with the job
Результат Cake\ORM\Entity Saved job entity

getLength() публичный Метод

Either returns the number of ALL pending jobs, or the number of pending jobs of the passed type.
public getLength ( string | null $type = null ) : integer
$type string | null Job type to Count
Результат integer

getPendingStats() публичный Метод

Return some statistics about unfinished jobs still in the Database.
public getPendingStats ( ) : array
Результат array

getStats() публичный Метод

TO-DO: rewrite as virtual field
public getStats ( ) : array
Результат array

getTypes() публичный Метод

Return a list of all job types in the Queue.
public getTypes ( ) : array
Результат array

initConfig() публичный Метод

public initConfig ( ) : void
Результат void

initialize() публичный Метод

initialize Table
public initialize ( array $config ) : void
$config array Configuration
Результат void

key() публичный Метод

Useful to identify the currently running processes for this thread.
public key ( ) : string
Результат string Identifier

lastRun() публичный Метод

Устаревший: ?
public lastRun ( ) : array
Результат array

markJobDone() публичный Метод

Mark a job as Completed, removing it from the queue.
public markJobDone ( Queue\Model\Entity\QueuedJob $job ) : boolean
$job Queue\Model\Entity\QueuedJob Job
Результат boolean Success

markJobFailed() публичный Метод

Mark a job as Failed, incrementing the failed-counter and Requeueing it.
public markJobFailed ( Queue\Model\Entity\QueuedJob $job, string | null $failureMessage = null ) : boolean
$job Queue\Model\Entity\QueuedJob Job
$failureMessage string | null Optional message to append to the failure_message field.
Результат boolean Success

requestJob() публичный Метод

Look for a new job that can be processed with the current abilities and from the specified group (or any if null).
public requestJob ( array $capabilities, string | null $group = null ) : Queue\Model\Entity\QueuedJob | null
$capabilities array Available QueueWorkerTasks.
$group string | null Request a job from this group, (from any group if null)
Результат Queue\Model\Entity\QueuedJob | null

reset() публичный Метод

Reset current jobs
public reset ( ) : boolean
Результат boolean Success

truncate() публичный Метод

truncate()
public truncate ( ) : void
Результат void

updateProgress() публичный Метод

public updateProgress ( integer $id, float $progress ) : boolean
$id integer ID of job
$progress float Value from 0 to 1
Результат boolean Success

Описание свойств

$_key защищенное свойство

protected string|null $_key
Результат string | null

$findMethods публичное свойство

public array $findMethods
Результат array

$rateHistory публичное свойство

public array $rateHistory
Результат array