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
파일 보기 프로젝트 열기: urbanindo/yii2-queue

공개 프로퍼티들

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