PHP Class UrbanIndo\Yii2\Queue\Web\WorkerController

The motivation comes from the HHVM limitation for running PHP terminal script.
Author: Petra Barus ([email protected])
Author: Adinata ([email protected])
Inheritance: extends yii\web\Controller
Show file Open project: urbanindo/yii2-queue

Public Properties

Property Type Description
$defaultQueue string | array The default queue component name or component configuration to use when there is no queue param sent in the request.
$enableCsrfValidation boolean
$queueParamName string This will check the parameter of the POST first. If there is no value for the param, then it will check the GET. If there is still no value, then the queue component name will use the defaultQueue.

Public Methods

Method Description
actionRun ( ) : mixed Run a task by request.
actionRunTask ( ) Run a task without going to queue.

Protected Methods

Method Description
executeJob ( Queue $queue, UrbanIndo\Yii2\Queue\Job $job ) : array
getDummyModule ( ) : string
getQueue ( ) : Queue Returns the queue component.

Private Methods

Method Description
getComponentParamFromRequest ( ) : string

Method Details

actionRun() public method

Run a task by request.
public actionRun ( ) : mixed
return mixed

actionRunTask() public method

This is useful to test the task controller. The route and data will be retrieved from POST data.
public actionRunTask ( )

executeJob() protected method

protected executeJob ( Queue $queue, UrbanIndo\Yii2\Queue\Job $job ) : array
$queue UrbanIndo\Yii2\Queue\Queue Queue the job located.
$job UrbanIndo\Yii2\Queue\Job Job to be executed.
return array

getDummyModule() protected method

protected getDummyModule ( ) : string
return string Module name.

getQueue() protected method

This will check if there is a queue component from.
protected getQueue ( ) : Queue
return UrbanIndo\Yii2\Queue\Queue

Property Details

$defaultQueue public property

The default queue component name or component configuration to use when there is no queue param sent in the request.
public string|array $defaultQueue
return string | array

$enableCsrfValidation public property

public bool $enableCsrfValidation
return boolean

$queueParamName public property

This will check the parameter of the POST first. If there is no value for the param, then it will check the GET. If there is still no value, then the queue component name will use the defaultQueue.
public string $queueParamName
return string