Abstract Class yii\queue\cli\Queue

Inheritanceyii\queue\cli\Queue » yii\queue\Queue » yii\base\Component
Implementsyii\base\BootstrapInterface
Subclassesyii\queue\amqp\Queue, yii\queue\amqp_interop\Queue, yii\queue\beanstalk\Queue, yii\queue\db\Queue, yii\queue\file\Queue, yii\queue\gearman\Queue, yii\queue\redis\Queue

Queue with CLI

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
STATUS_DONE 3 yii\queue\Queue
STATUS_RESERVED 2 yii\queue\Queue
STATUS_WAITING 1 yii\queue\Queue

Property Details

$commandClass public property

Command class name

public string $commandClass = \yii\queue\cli\Command::class
$commandOptions public property

Of additional options of command

public array $commandOptions = []
$loopConfig public property (available since version 2.0.2)
public array|string $loopConfig = \yii\queue\cli\SignalLoop::class
$messageHandler public property

Method Details

bootstrap() public method

public void bootstrap ( $app )
$app
execute() public method

public boolean execute ( $id, $message, $ttr, $attempt, $workerPid )
$id string

Of a message

$message string
$ttr integer

Time to reserve

$attempt integer

Number

$workerPid integer

Of worker process

getCommandId() protected method

protected string getCommandId ( )
return string

Command id

throws
getWorkerPid() public method (available since version 2.0.2)

Gets process ID of a worker.

public integer getWorkerPid ( )
handleMessage() protected method

protected boolean handleMessage ( $id, $message, $ttr, $attempt )
$id string

Of a job message

$message string
$ttr integer

Time to reserve

$attempt integer

Number

runWorker() protected method (available since version 2.0.2)

Runs worker.

protected null|integer runWorker ( callable $handler )
$handler callable
return null|integer

Exit code

Event Details

EVENT_WORKER_START event of type yii\queue\cli\WorkerEvent (available since version 2.0.2)
EVENT_WORKER_STOP event of type yii\queue\cli\WorkerEvent (available since version 2.0.2)