Class yii\queue\amqp_interop\Queue

Inheritanceyii\queue\amqp_interop\Queue » yii\queue\cli\Queue » yii\queue\Queue » yii\base\Component » yii\base\BaseObject
Implementsyii\base\BootstrapInterface, yii\base\Configurable
Available since version2.0.2
Source Code https://github.com/yiisoft/yii2-queue/blob/master/amqp_interop/Queue.php

Amqp Queue.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$attempts integer Default attempt count yii\queue\Queue
$behaviors yii\base\Behavior[] List of behaviors attached to this component. yii\base\Component
$commandClass string Command class name yii\queue\amqp_interop\Queue
$commandOptions array Of additional options of command yii\queue\cli\Queue
$connectionTimeout float|null yii\queue\amqp_interop\Queue
$driver string yii\queue\amqp_interop\Queue
$dsn string yii\queue\amqp_interop\Queue
$exchangeName string yii\queue\amqp_interop\Queue
$exchangeType string yii\queue\amqp_interop\Queue
$heartbeat float|null yii\queue\amqp_interop\Queue
$host string|null yii\queue\amqp_interop\Queue
$lazy boolean|null yii\queue\amqp_interop\Queue
$loopConfig array|string yii\queue\cli\Queue
$maxPriority integer yii\queue\amqp_interop\Queue
$messageHandler callable|null yii\queue\cli\Queue
$password string|null yii\queue\amqp_interop\Queue
$persisted boolean|null yii\queue\amqp_interop\Queue
$port string|null yii\queue\amqp_interop\Queue
$qosGlobal boolean|null yii\queue\amqp_interop\Queue
$qosPrefetchCount integer|null yii\queue\amqp_interop\Queue
$qosPrefetchSize integer|null yii\queue\amqp_interop\Queue
$queueName string yii\queue\amqp_interop\Queue
$queueOptionalArguments array yii\queue\amqp_interop\Queue
$readTimeout float|null yii\queue\amqp_interop\Queue
$routingKey string|null yii\queue\amqp_interop\Queue
$serializer yii\queue\serializers\SerializerInterface|array yii\queue\Queue
$sslCacert string|null yii\queue\amqp_interop\Queue
$sslCert string|null yii\queue\amqp_interop\Queue
$sslKey string|null yii\queue\amqp_interop\Queue
$sslOn boolean|null yii\queue\amqp_interop\Queue
$sslVerify boolean|null yii\queue\amqp_interop\Queue
$strictJobType boolean Whether to enable strict job type control. yii\queue\Queue
$ttr integer Default time to reserve a job yii\queue\Queue
$user string|null yii\queue\amqp_interop\Queue
$vhost string|null yii\queue\amqp_interop\Queue
$workerPid null|integer yii\queue\Queue
$writeTimeout float|null yii\queue\amqp_interop\Queue

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\Component
__clone() This method is called after the object is created by cloning an existing one. yii\base\Component
__construct() Constructor. yii\base\BaseObject
__get() Returns the value of a component property. yii\base\Component
__isset() Checks if a property is set, i.e. defined and not null. yii\base\Component
__set() Sets the value of a component property. yii\base\Component
__unset() Sets a component property to be null. yii\base\Component
attachBehavior() Attaches a behavior to this component. yii\base\Component
attachBehaviors() Attaches a list of behaviors to the component. yii\base\Component
behaviors() Returns a list of behaviors that this component should behave as. yii\base\Component
bootstrap() Bootstrap method to be called during application bootstrap stage. yii\queue\cli\Queue
canGetProperty() Returns a value indicating whether a property can be read. yii\base\Component
canSetProperty() Returns a value indicating whether a property can be set. yii\base\Component
className() Returns the fully qualified name of this class. yii\base\BaseObject
delay() Sets delay for later execute. yii\queue\Queue
detachBehavior() Detaches a behavior from the component. yii\base\Component
detachBehaviors() Detaches all behaviors from the component. yii\base\Component
ensureBehaviors() Makes sure that the behaviors declared in behaviors() are attached to this component. yii\base\Component
execute() yii\queue\cli\Queue
getBehavior() Returns the named behavior object. yii\base\Component
getBehaviors() Returns all behaviors attached to this component. yii\base\Component
getContext() yii\queue\amqp_interop\Queue
getWorkerPid() Gets process ID of a worker. yii\queue\cli\Queue
handleError() yii\queue\Queue
hasEventHandlers() Returns a value indicating whether there is any handler attached to the named event. yii\base\Component
hasMethod() Returns a value indicating whether a method is defined. yii\base\Component
hasProperty() Returns a value indicating whether a property is defined for this component. yii\base\Component
init() Initializes the object. yii\queue\amqp_interop\Queue
isDone() yii\queue\Queue
isReserved() yii\queue\Queue
isWaiting() yii\queue\Queue
listen() Listens amqp-queue and runs new jobs. yii\queue\amqp_interop\Queue
off() Detaches an existing event handler from this component. yii\base\Component
on() Attaches an event handler to an event. yii\base\Component
priority() Sets job priority. yii\queue\Queue
push() Pushes job into queue. yii\queue\Queue
status() yii\queue\amqp_interop\Queue
trigger() Triggers an event. yii\base\Component
ttr() Sets TTR for job execute. yii\queue\Queue
unserializeMessage() Unserializes. yii\queue\Queue

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_AFTER_ERROR yii\queue\ExecEvent yii\queue\Queue
EVENT_AFTER_EXEC yii\queue\ExecEvent yii\queue\Queue
EVENT_AFTER_PUSH yii\queue\PushEvent yii\queue\Queue
EVENT_BEFORE_EXEC yii\queue\ExecEvent yii\queue\Queue
EVENT_BEFORE_PUSH yii\queue\PushEvent yii\queue\Queue
EVENT_WORKER_LOOP yii\queue\cli\WorkerEvent That is triggered each iteration between requests to queue. (available since version 2.0.3) yii\queue\cli\Queue
EVENT_WORKER_START yii\queue\cli\WorkerEvent That is triggered when the worker is started. (available since version 2.0.2) yii\queue\cli\Queue
EVENT_WORKER_STOP yii\queue\cli\WorkerEvent That is triggered when the worker is stopped. (available since version 2.0.2) yii\queue\cli\Queue

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
ATTEMPT 'yii-attempt' yii\queue\amqp_interop\Queue
DELAY 'yii-delay' yii\queue\amqp_interop\Queue
ENQUEUE_AMQP_BUNNY 'enqueue/amqp-bunny' yii\queue\amqp_interop\Queue
ENQUEUE_AMQP_EXT 'enqueue/amqp-ext' yii\queue\amqp_interop\Queue
ENQUEUE_AMQP_LIB 'enqueue/amqp-lib' yii\queue\amqp_interop\Queue
PRIORITY 'yii-priority' yii\queue\amqp_interop\Queue
STATUS_DONE 3 yii\queue\Queue
STATUS_RESERVED 2 yii\queue\Queue
STATUS_WAITING 1 yii\queue\Queue
TTR 'yii-ttr' yii\queue\amqp_interop\Queue

Property Details

$commandClass public property

Command class name

public string $commandClass = \yii\queue\amqp_interop\Command::class
$connectionTimeout public property
$context protected property
protected \Interop\Amqp\AmqpContext $context null
$driver public property
public string $driver self::ENQUEUE_AMQP_LIB
$dsn public property
public string $dsn null
$exchangeName public property
public string $exchangeName 'exchange'
$exchangeType public property (available since version 2.3.3)
public string $exchangeType = \Interop\Amqp\AmqpTopic::TYPE_DIRECT
$heartbeat public property
public float|null $heartbeat null
$host public property
public string|null $host null
$lazy public property
public boolean|null $lazy null
$maxPriority public property
public integer $maxPriority 10
$password public property
public string|null $password null
$persisted public property
public boolean|null $persisted null
$port public property
public string|null $port null
$qosGlobal public property
public boolean|null $qosGlobal null
$qosPrefetchCount public property
$qosPrefetchSize public property
$queueName public property
public string $queueName 'interop_queue'
$queueOptionalArguments public property (available since version 2.3.3)
$readTimeout public property
public float|null $readTimeout null
$routingKey public property
public string|null $routingKey null
$setupBrokerDone protected property
protected boolean $setupBrokerDone false
$sslCacert public property
public string|null $sslCacert null
$sslCert public property
public string|null $sslCert null
$sslKey public property
public string|null $sslKey null
$sslOn public property
public boolean|null $sslOn null
$sslVerify public property
public boolean|null $sslVerify null
$supportedDrivers protected property
protected string[] $supportedDrivers = [
    self::ENQUEUE_AMQP_LIB,
    
self::ENQUEUE_AMQP_EXT,
    
self::ENQUEUE_AMQP_BUNNY
]
$user public property
public string|null $user null
$vhost public property
public string|null $vhost null
$writeTimeout public property
public float|null $writeTimeout null

Method Details

close() protected method

Closes connection and channel.

protected void close ( )
getContext() public method

public \Interop\Amqp\AmqpContext getContext ( )
init() public method

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

public void init ( )
listen() public method

Listens amqp-queue and runs new jobs.

public void listen ( )
open() protected method

Opens connection and channel.

protected void open ( )
pushMessage() protected method

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

Time to reserve in seconds

$delay integer
$priority mixed
return string

Id of a job message

redeliver() protected method

protected void redeliver ( \Interop\Amqp\AmqpMessage $message )
$message
setupBroker() protected method

protected void setupBroker ( )
status() public method

public integer status ( $id )
$id string

Of a job message

return integer

Status code