Class yii\queue\file\Queue

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

File 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

$commandClass public property
public string $commandClass = \yii\queue\file\Command::class
$dirMode public property
public integer $dirMode 0755
$fileMode public property
public integer|null $fileMode null
$indexDeserializer public property
public callable $indexDeserializer 'unserialize'
$indexSerializer public property
public callable $indexSerializer 'serialize'
$path public property
public string $path '@runtime/queue'

Method Details

clear() public method (available since version 2.0.1)

Clears the queue

public void clear ( )
delete() protected method

Deletes reserved message

protected void delete ( $payload )
$payload array
init() public method

public void init ( )
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

Reserves message for execute

protected array|null reserve ( )
return array|null

Payload

run() public method (available since version 2.0.2)

Listens queue and runs each job.

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

Whether to continue listening when queue is empty.

$delay integer

Number of seconds to sleep before next iteration.

return null|integer

Exit code.

status() public method

public integer status ( $id )
$id string

Of a job message

return integer

Status code