PHP Class Queue\Shell\Task\QueueTask

Common Queue plugin tasks properties and methods to be extended by custom tasks.
Inheritance: extends Cake\Console\Shell
Mostrar archivo Open project: dereuromark/cakephp-queue Class Usage Examples

Public Properties

Property Type Description
$QueuedJobs Queue\Model\Table\QueuedJobsTable
$queueModelClass string
$retries integer Number of times a failed instance of this task should be restarted before giving up.
$timeout integer Timeout for run, after which the Task is reassigned to a new worker.

Public Methods

Method Description
__construct ( ConsoleIo $io = null )
add ( ) : void Add functionality.
run ( array $data, integer $id ) : boolean Run function.

Method Details

__construct() public method

public __construct ( ConsoleIo $io = null )
$io Cake\Console\ConsoleIo IO

add() public method

Add functionality.
public add ( ) : void
return void

run() public method

This function is executed, when a worker is executing a task. The return parameter will determine, if the task will be marked completed, or be requeued.
public run ( array $data, integer $id ) : boolean
$data array The array passed to QueuedTask->createJob()
$id integer The id of the QueuedTask
return boolean Success

Property Details

$QueuedJobs public_oe property

public QueuedJobsTable,Queue\Model\Table $QueuedJobs
return Queue\Model\Table\QueuedJobsTable

$queueModelClass public_oe property

public string $queueModelClass
return string

$retries public_oe property

Number of times a failed instance of this task should be restarted before giving up.
public int $retries
return integer

$timeout public_oe property

Timeout for run, after which the Task is reassigned to a new worker.
public int $timeout
return integer