PHP Класс UrbanIndo\Yii2\Queue\Console\Controller

To use the controller, update the controllerMap. return [ ... 'controllerMap' => [ 'queue' => 'UrbanIndo\Yii2\Queue\Console\QueueController' ], ]; OR return [ ... 'controllerMap' => [ 'queue' => [ 'class' => 'UrbanIndo\Yii2\Queue\Console\QueueController', 'sleepTimeout' => 1 ] ], ]; To run yii queue
С версии: 2015.02.24
Автор: Petra Barus ([email protected])
Наследование: extends yii\console\Controller
Показать файл Открыть проект

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

Свойство Тип Описание
$queue the name of the queue component. default to 'queue'.
$sleepTimeout sleep timeout for infinite loop in second

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

Метод Описание
actionListen ( string $cwd = null, integer $timeout = null, array $env = [] ) : void This will continuously run new subprocesses to fetch job from the queue.
actionPeek ( integer $count = 1 ) : void Peek messages from queue that are still active.
actionPost ( string $route, string $data = '{}' ) : void Post a job to the queue.
actionPurge ( integer $count = 1 ) : void Purging messages from queue that are still active.
actionRun ( ) : void Fetch a job from the queue.
actionRunTask ( string $route, string $data = '{}' ) : void Run a task without going to queue.
actionTest ( ) : void
init ( ) : void
options ( string $actionID ) : array
setName ( string $value ) : void Sets the name of the command. This should be overriden in the config.

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

Метод Описание
createJob ( string $route, string $data = '{}' ) : UrbanIndo\Yii2\Queue\Job Create a job from route and data.
getScriptPath ( ) : string Returns the script path.
initSignalHandler ( ) : void Initialize signal handler for the process.
runQueueFetching ( string $command, string $cwd = null, integer $timeout = null, array $env = [] ) : void Run the queue fetching process.

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

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

This will continuously run new subprocesses to fetch job from the queue.
public actionListen ( string $cwd = null, integer $timeout = null, array $env = [] ) : void
$cwd string The working directory.
$timeout integer Timeout.
$env array The environment to passed to the sub process. The format for each element is 'KEY=VAL'.
Результат void

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

Peek messages from queue that are still active.
public actionPeek ( integer $count = 1 ) : void
$count integer Number of messages to peek.
Результат void

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

Post a job to the queue.
public actionPost ( string $route, string $data = '{}' ) : void
$route string The route.
$data string The data in JSON format.
Результат void

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

Purging messages from queue that are still active.
public actionPurge ( integer $count = 1 ) : void
$count integer Number of messages to delete.
Результат void

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

Fetch a job from the queue.
public actionRun ( ) : void
Результат void

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

This is useful to test the task controller.
public actionRunTask ( string $route, string $data = '{}' ) : void
$route string The route.
$data string The data in JSON format.
Результат void

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

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

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

Create a job from route and data.
protected createJob ( string $route, string $data = '{}' ) : UrbanIndo\Yii2\Queue\Job
$route string The route.
$data string The JSON data.
Результат UrbanIndo\Yii2\Queue\Job

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

Returns the script path.
protected getScriptPath ( ) : string
Результат string

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

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

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

Initialize signal handler for the process.
protected initSignalHandler ( ) : void
Результат void

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

public options ( string $actionID ) : array
$actionID string The action id of the current request.
Результат array the names of the options valid for the action

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

Run the queue fetching process.
protected runQueueFetching ( string $command, string $cwd = null, integer $timeout = null, array $env = [] ) : void
$command string The command.
$cwd string The working directory.
$timeout integer The timeout.
$env array The environment to be passed.
Результат void

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

Sets the name of the command. This should be overriden in the config.
public setName ( string $value ) : void
$value string The value.
Результат void

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

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

the name of the queue component. default to 'queue'.
public $queue

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

sleep timeout for infinite loop in second
public $sleepTimeout