Class yii\queue\beanstalk\Queue

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

Beanstalk 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

Command class name

public string $commandClass = \yii\queue\beanstalk\Command::class
$host public property

Connection host

public string $host 'localhost'
$port public property

Connection port

public integer $port = \Pheanstalk\PheanstalkInterface::DEFAULT_PORT
$tube public property

Beanstalk tube

public string $tube 'queue'

Method Details

getPheanstalk() protected method

protected \Pheanstalk\Pheanstalk getPheanstalk ( )
getStatsTube() public method

public object getStatsTube ( )
return object

Tube statistics

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

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