Class yii\queue\redis\Queue

Inheritanceyii\queue\redis\Queue » yii\queue\cli\Queue » yii\queue\Queue » yii\base\Component
Implementsyii\base\BootstrapInterface

Redis Queue

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

$channel public property
public string $channel 'queue'
$commandClass public property

Command class name

public string $commandClass = \yii\queue\redis\Command::class
$redis public property
public \yii\redis\Connection|array|string $redis 'redis'

Method Details

clear() public method (available since version 2.0.1)

Clears the queue

public void clear ( )
closeWorker() protected method

protected void closeWorker ( )
delete() protected method

Deletes message by ID

protected void delete ( $id )
$id integer

Of a message

init() public method

public void init ( )
moveExpired() protected method

protected void moveExpired ( $from )
$from string
openWorker() protected method

protected void openWorker ( )
pushMessage() protected method

protected string pushMessage ( $message, $ttr, $delay, $priority )
$message string
$ttr integer

Time to reserve in seconds

$delay integer
$priority mixed
return string

Id of a job message

remove() public method (available since version 2.0.1)

Removes a job by ID

public boolean remove ( $id )
$id integer

Of a job

reserve() protected method

protected array|null reserve ( $timeout )
$timeout integer

Timeout

return array|null

Payload

run() public method (available since version 2.0.2)

Listens queue and runs each job.

public null|integer run ( $repeat, $timeout 0 )
$repeat boolean

Whether to continue listening when queue is empty.

$timeout integer

Number of seconds to wait for next message.

return null|integer

Exit code.

status() public method

public integer status ( $id )
$id string

Of a job message

return integer

Status code