PHP 클래스 Queue\Model\Table\QueuedJobsTable

상속: extends Cake\ORM\Table
파일 보기 프로젝트 열기: dereuromark/cakephp-queue 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$findMethods array
$rateHistory array

보호된 프로퍼티들

프로퍼티 타입 설명
$_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