Phalcon queue
NOTE
All classes are prefixed with Phalcon
Queue\AdapterFactory¶
Class Source on GitHub
Maps an adapter name to its ConnectionFactory. Mirrors Phalcon\Storage\AdapterFactory.
Phalcon\Factory\AbstractConfigFactoryPhalcon\Factory\AbstractFactoryPhalcon\Queue\AdapterFactory
Uses Phalcon\Contracts\Queue\ConnectionFactory · Phalcon\Factory\AbstractFactory
Method Summary¶
public
__construct( array $services = [] )
AdapterFactory constructor.
public
ConnectionFactoryInterface
newInstance(string $name,array $options = [])
Creates a new ConnectionFactory for the named adapter.
protected
string
getExceptionClass()
protected
array
getServices()
Returns the available adapters.
Methods¶
__construct()¶
AdapterFactory constructor.
newInstance()¶
Creates a new ConnectionFactory for the named adapter.
getExceptionClass()¶
getServices()¶
Returns the available adapters.
Queue\Adapter\AbstractConsumer¶
Abstract Source on GitHub
Shared consumer base. Implements the blocking receive() as a polling loop
on top of the abstract receiveNoWait(); concrete consumers provide the
transport-specific receiveNoWait, acknowledge and reject.
Transports with a native blocking receive (Redis BRPOP, Beanstalk reserve)
override receive() instead of polling.
Phalcon\Queue\Adapter\AbstractConsumer- implementsPhalcon\Contracts\Queue\Consumer
Uses Phalcon\Contracts\Queue\Consumer · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Queue
Method Summary¶
public
void
acknowledge( MessageInterface $message )
Acknowledges the message; the transport may then discard it.
public
QueueInterface
getQueue()
Returns the queue this consumer reads from.
public
MessageInterface|null
receive( int $timeout = 0 )
Receives a message, blocking up to timeout milliseconds (0 = block
public
MessageInterface|null
receiveNoWait()
Receives a message without blocking, or null when none is ready.
public
void
reject(MessageInterface $message,bool $requeue = false)
Rejects the message. When requeue is true the transport redelivers it.
public
void
setPollInterval( int $pollInterval )
Sets the poll interval (in milliseconds) used by receive().
Properties¶
protected
int
$pollInterval = 200
Milliseconds slept between poll attempts.
protected
QueueInterface
$queue
The queue this consumer reads from.
Methods¶
acknowledge()¶
Acknowledges the message; the transport may then discard it.
getQueue()¶
Returns the queue this consumer reads from.
receive()¶
Receives a message, blocking up to timeout milliseconds (0 = block
until one is available), by polling receiveNoWait() every
pollInterval milliseconds. Returns null when none arrives in time.
receiveNoWait()¶
Receives a message without blocking, or null when none is ready.
reject()¶
Rejects the message. When requeue is true the transport redelivers it.
setPollInterval()¶
Sets the poll interval (in milliseconds) used by receive().
Queue\Adapter\AbstractContext¶
Abstract Source on GitHub
Shared transport-session base. Every transport builds the same destination value objects (GenericQueue / GenericTopic) and the same uniquely named temporary queue, so those factories live here once. Concrete contexts implement the transport-specific factories (consumer, producer, message, subscription consumer) and the storage operations.
Phalcon\Queue\Adapter\AbstractContext- implementsPhalcon\Contracts\Queue\Context
Uses Phalcon\Contracts\Queue\Context · Phalcon\Contracts\Queue\Queue · Phalcon\Contracts\Queue\Topic
Method Summary¶
public
QueueInterface
createQueue( string $queueName )
Creates a queue destination by name.
public
QueueInterface
createTemporaryQueue()
Creates a uniquely named temporary queue.
public
TopicInterface
createTopic( string $topicName )
Creates a topic destination by name.
Methods¶
createQueue()¶
Creates a queue destination by name.
createTemporaryQueue()¶
Creates a uniquely named temporary queue.
createTopic()¶
Creates a topic destination by name.
Queue\Adapter\AbstractMessage¶
Abstract Source on GitHub
Shared base for the concrete adapter messages.
@todo Remove in v7. Kept only for backwards compatibility; compose Phalcon\Queue\Adapter\Traits\MessageTrait directly instead of extending this.
Phalcon\Queue\Adapter\AbstractMessage- implementsPhalcon\Contracts\Queue\Message
Uses Phalcon\Contracts\Queue\Message · Phalcon\Queue\Adapter\Traits\MessageTrait
Queue\Adapter\AbstractProducer¶
Abstract Source on GitHub
Shared producer base. Defaults every optional capability (delivery delay,
priority, time to live) to "unsupported": the getter returns null and the
setter throws the matching exception for any non-null value. A concrete
producer overrides only the capabilities its transport actually supports,
and implements send().
Phalcon\Queue\Adapter\AbstractProducer- implementsPhalcon\Contracts\Queue\Producer
Uses Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Producer · Phalcon\Queue\Exceptions\DeliveryDelayNotSupportedException · Phalcon\Queue\Exceptions\PriorityNotSupportedException · Phalcon\Queue\Exceptions\TimeToLiveNotSupportedException
Method Summary¶
public
int|null
getDeliveryDelay()
public
int|null
getPriority()
public
int|null
getTimeToLive()
public
void
send(DestinationInterface $destination,MessageInterface $message)
public
ProducerInterface
setDeliveryDelay( mixed $deliveryDelay = null )
public
ProducerInterface
setPriority( mixed $priority = null )
public
ProducerInterface
setTimeToLive( mixed $timeToLive = null )
Methods¶
getDeliveryDelay()¶
getPriority()¶
getTimeToLive()¶
send()¶
abstract public function send(
DestinationInterface $destination,
MessageInterface $message
): void;
setDeliveryDelay()¶
setPriority()¶
setTimeToLive()¶
Queue\Adapter\AbstractSubscriptionConsumer¶
Abstract Source on GitHub
Shared subscription-consumer base.
@todo Remove in v7. Kept only for backwards compatibility; compose Phalcon\Queue\Adapter\Traits\SubscriptionConsumerTrait directly instead of extending this.
Phalcon\Queue\Adapter\AbstractSubscriptionConsumer- implementsPhalcon\Contracts\Queue\SubscriptionConsumer
Uses Phalcon\Contracts\Queue\SubscriptionConsumer · Phalcon\Queue\Adapter\Traits\SubscriptionConsumerTrait
Queue\Adapter\Beanstalk\BeanstalkConnection¶
Class Source on GitHub
Dependency-free socket client for the Beanstalkd work queue, implementing the subset of the 1.2 protocol the adapter needs (use/watch/ignore, put, reserve-with-timeout, delete/release/bury/touch). Recovered and trimmed from the original Phalcon\Queue\Beanstalk transport.
Phalcon\Queue\Adapter\Beanstalk\BeanstalkConnection
Uses Phalcon\Queue\Exceptions\Exception · Phalcon\Traits\Php\FileTrait
Method Summary¶
public
__construct(string $host = "127.0.0.1",int $port = 11300,bool $persistent = false)
public
bool
buryJob(string $id,int $priority)
Puts a reserved job into the "buried" state.
public
resource
connect()
Opens the socket connection to the Beanstalkd server.
public
bool
deleteJob( string $id )
Removes a job from the server entirely.
public
bool
disconnect()
Closes the connection to the server.
public
bool
ignoreTube( string $tube )
Removes the named tube from the watch list for the connection.
public
int|bool
put(string $data,int $priority,int $delay,int $ttr)
Puts a job on the queue using the currently used tube. Returns the new
public
bool|string
read( int $length = 0 )
Reads a packet from the socket. Verifies the connection is available
public
array
readStatus()
Reads the latest status line and splits it into tokens.
public
bool
releaseJob(string $id,int $priority,int $delay)
Puts a reserved job back into the ready queue.
public
array|null
reserve( mixed $timeout = null )
Reserves a ready job from a watched tube. A null timeout blocks until a
public
array|bool
statsTube( string $tube )
Returns the Beanstalkd statistics for a tube as an associative array, or
public
bool
touchJob( string $id )
Extends the time-to-run of a reserved job.
public
bool
useTube( string $tube )
Changes the tube new jobs are put on. By default this is "default".
public
bool
watchTube( string $tube )
Adds the named tube to the watch list for the connection.
public
bool|int
write( string $data )
Writes data to the socket, connecting first when needed.
Properties¶
protected
resource
$connection
Connection resource.
protected
string
$host = "127.0.0.1"
protected
bool
$persistent = false
protected
int
$port = 11300
protected
string
$usedTube = "default"
Tube currently selected with use. A fresh connection uses "default".
protected
array
$watchedTubes = []
Tubes currently on the watch list, keyed by tube name. A fresh
connection watches "default".
Methods¶
__construct()¶
public function __construct(
string $host = "127.0.0.1",
int $port = 11300,
bool $persistent = false
);
buryJob()¶
Puts a reserved job into the "buried" state.
connect()¶
Opens the socket connection to the Beanstalkd server.
deleteJob()¶
Removes a job from the server entirely.
disconnect()¶
Closes the connection to the server.
ignoreTube()¶
Removes the named tube from the watch list for the connection.
put()¶
Puts a job on the queue using the currently used tube. Returns the new job id, or false when the server did not accept it.
read()¶
Reads a packet from the socket. Verifies the connection is available first.
readStatus()¶
Reads the latest status line and splits it into tokens.
releaseJob()¶
Puts a reserved job back into the ready queue.
reserve()¶
Reserves a ready job from a watched tube. A null timeout blocks until a job is available; otherwise it blocks up to timeout seconds. Returns [id, body] or null when none is reserved.
statsTube()¶
Returns the Beanstalkd statistics for a tube as an associative array, or false when the tube does not exist.
touchJob()¶
Extends the time-to-run of a reserved job.
useTube()¶
Changes the tube new jobs are put on. By default this is "default".
watchTube()¶
Adds the named tube to the watch list for the connection.
write()¶
Writes data to the socket, connecting first when needed.
Queue\Adapter\Beanstalk\BeanstalkConnectionFactory¶
Class Source on GitHub
Builds a BeanstalkContext.
Options: - host: server host (default 127.0.0.1). - port: server port (default 11300). - persistent: use a persistent socket (default false). - ttr: default time-to-run in seconds for every job (default 86400). - pollInterval: milliseconds between subscription poll passes (default 200).
Phalcon\Queue\Adapter\Beanstalk\BeanstalkConnectionFactory- implementsPhalcon\Contracts\Queue\ConnectionFactory
Uses Phalcon\Contracts\Queue\ConnectionFactory · Phalcon\Contracts\Queue\Context
Method Summary¶
Properties¶
protected
array
$options = []
Methods¶
__construct()¶
createContext()¶
Queue\Adapter\Beanstalk\BeanstalkConsumer¶
Class Source on GitHub
Receives messages from a single Beanstalkd tube over its own connection.
receive() is overridden to use the native blocking reserve. Implements
VisibilityAware: a reserved job has a time-to-run window that touch()
extends; acknowledging deletes the job, rejecting releases it (requeue) or
buries it.
Phalcon\Queue\Adapter\AbstractConsumerPhalcon\Queue\Adapter\Beanstalk\BeanstalkConsumer- implementsPhalcon\Contracts\Queue\VisibilityAware
Uses Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Queue · Phalcon\Contracts\Queue\VisibilityAware · Phalcon\Queue\Adapter\AbstractConsumer · Phalcon\Queue\Adapter\MessageEnvelope
Method Summary¶
public
__construct(BeanstalkConnection $connection,QueueInterface $queue)
public
void
acknowledge( MessageInterface $message )
public
MessageInterface|null
receive( int $timeout = 0 )
public
MessageInterface|null
receiveNoWait()
public
void
reject(MessageInterface $message,bool $requeue = false)
public
bool
touch( MessageInterface $message )
Extends the time-to-run window of a reserved job (VisibilityAware).
Constants¶
int
DEFAULT_PRIORITY = 100
Default Beanstalkd priority used when releasing or burying.
Properties¶
protected
BeanstalkConnection
$connection
Methods¶
__construct()¶
acknowledge()¶
receive()¶
receiveNoWait()¶
reject()¶
touch()¶
Extends the time-to-run window of a reserved job (VisibilityAware).
Queue\Adapter\Beanstalk\BeanstalkContext¶
Class Source on GitHub
Beanstalkd transport session. A queue maps to a Beanstalkd tube. Producers
share the context connection (use + put); each consumer owns its own
connection, because Beanstalkd only lets the reserving connection delete,
release, bury or touch a job. The destination factories come from
AbstractContext.
Phalcon\Queue\Adapter\AbstractContextPhalcon\Queue\Adapter\Beanstalk\BeanstalkContext- implementsPhalcon\Contracts\Queue\Inspectable
Uses Phalcon\Contracts\Queue\Consumer · Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Inspectable · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Producer · Phalcon\Contracts\Queue\Queue · Phalcon\Contracts\Queue\SubscriptionConsumer · Phalcon\Queue\Adapter\AbstractContext · Phalcon\Queue\Adapter\QueueDestinationGuard
Method Summary¶
public
__construct(string $host,int $port,bool $persistent = false,int $ttr = 86400,int $pollInterval = 200)
public
void
close()
public
ConsumerInterface
createConsumer( DestinationInterface $destination )
public
MessageInterface
createMessage(string $body = "",array $properties = [],array $headers = [])
public
ProducerInterface
createProducer()
public
SubscriptionConsumerInterface
createSubscriptionConsumer()
public
array
getStats( QueueInterface $queue )
Returns the Beanstalkd stats-tube fields for the queue's tube as an
public
int
getTtr()
Default time-to-run (seconds) for new jobs. Used by BeanstalkProducer.
public
void
purgeQueue( QueueInterface $queue )
public
void
putMessage(string $tube,string $payload,int $priority,int $delay,int $ttr)
Puts a serialized payload on a tube via the shared connection.
Properties¶
protected
BeanstalkConnection | null
$connection = null
Shared connection used by producers and purges.
protected
string
$host = "127.0.0.1"
protected
bool
$persistent = false
protected
int
$pollInterval = 200
Milliseconds slept between poll passes by a subscription consumer.
protected
int
$port = 11300
protected
int
$ttr = 86400
Default time-to-run (seconds) applied to every put.
Methods¶
__construct()¶
public function __construct(
string $host,
int $port,
bool $persistent = false,
int $ttr = 86400,
int $pollInterval = 200
);
close()¶
createConsumer()¶
createMessage()¶
public function createMessage(
string $body = "",
array $properties = [],
array $headers = []
): MessageInterface;
createProducer()¶
createSubscriptionConsumer()¶
getStats()¶
Returns the Beanstalkd stats-tube fields for the queue's tube as an
associative array, with numeric values cast to int (the name field is
kept as a string). When the tube exists the result is the full Beanstalkd
stats-tube field set (current-jobs-*, total-jobs, the cmd-* counters and
tube-configuration fields).
The current-jobs-* backlog keys are always present: an unknown tube
(no jobs, not used or watched) has zero backlog, so those keys are
returned at zero. This keeps the backlog shape independent of transient
watcher state. Runs on a fresh short-lived connection (like purgeQueue)
so the read never shares the producer's socket.
getTtr()¶
Default time-to-run (seconds) for new jobs. Used by BeanstalkProducer.
purgeQueue()¶
putMessage()¶
public function putMessage(
string $tube,
string $payload,
int $priority,
int $delay,
int $ttr
): void;
Puts a serialized payload on a tube via the shared connection. Internal transport API used by BeanstalkProducer.
Queue\Adapter\Beanstalk\BeanstalkMessage¶
Class Source on GitHub
Beanstalkd-backed message. Carries the reserved job id so the consumer can delete, release, bury or touch it; all other behavior comes from MessageTrait.
Phalcon\Queue\Adapter\AbstractMessagePhalcon\Queue\Adapter\Beanstalk\BeanstalkMessage
Uses Phalcon\Queue\Adapter\AbstractMessage
Method Summary¶
Properties¶
protected
string | null
$jobId = null
The reserved Beanstalkd job id, or null before it is reserved.
Methods¶
getJobId()¶
setJobId()¶
Queue\Adapter\Beanstalk\BeanstalkProducer¶
Class Source on GitHub
Sends messages to a Beanstalkd tube. Delivery delay (rounded down to whole seconds) and message priority are supported natively; Beanstalkd has no message expiry, so time to live is not (the default from AbstractProducer rejects it).
Phalcon\Queue\Adapter\AbstractProducerPhalcon\Queue\Adapter\Beanstalk\BeanstalkProducer
Uses Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Producer · Phalcon\Queue\Adapter\AbstractProducer · Phalcon\Queue\Adapter\MessageEnvelope · Phalcon\Queue\Adapter\QueueDestinationGuard
Method Summary¶
public
__construct( BeanstalkContext $context )
public
int|null
getDeliveryDelay()
public
int|null
getPriority()
public
void
send(DestinationInterface $destination,MessageInterface $message)
public
ProducerInterface
setDeliveryDelay( mixed $deliveryDelay = null )
public
ProducerInterface
setPriority( mixed $priority = null )
Constants¶
int
DEFAULT_PRIORITY = 100
Default Beanstalkd priority (0 = most urgent).
Properties¶
protected
BeanstalkContext
$context
protected
int | null
$deliveryDelay = null
Delivery delay in milliseconds, or null when not set.
protected
int | null
$priority = null
Job priority, or null when not set.
Methods¶
__construct()¶
getDeliveryDelay()¶
getPriority()¶
send()¶
setDeliveryDelay()¶
setPriority()¶
Queue\Adapter\Beanstalk\BeanstalkSubscriptionConsumer¶
Class Source on GitHub
Consumes from several Beanstalkd tubes at once. The round-robin poll loop lives in SubscriptionConsumerTrait.
Phalcon\Queue\Adapter\AbstractSubscriptionConsumerPhalcon\Queue\Adapter\Beanstalk\BeanstalkSubscriptionConsumer
Uses Phalcon\Queue\Adapter\AbstractSubscriptionConsumer
Method Summary¶
Properties¶
protected
BeanstalkContext
$context
Retained for transports that may later need it for a native multi-queue
receive; the shared poll loop does not use it.
Methods¶
__construct()¶
Queue\Adapter\GenericQueue¶
Class Source on GitHub
A named queue destination shared by every transport. A queue name is the only knowledge a destination carries, so the adapters need no transport specific subclass.
Phalcon\Queue\Adapter\GenericQueue- implementsPhalcon\Contracts\Queue\Queue
Uses Phalcon\Contracts\Queue\Queue
Method Summary¶
public
__construct( string $queueName )
GenericQueue constructor.
public
string
getQueueName()
Returns the queue name.
Properties¶
protected
string
$queueName = ""
Methods¶
__construct()¶
GenericQueue constructor.
getQueueName()¶
Returns the queue name.
Queue\Adapter\GenericTopic¶
Class Source on GitHub
A named topic destination shared by every transport. A topic name is the only knowledge a destination carries, so the adapters need no transport specific subclass.
Phalcon\Queue\Adapter\GenericTopic- implementsPhalcon\Contracts\Queue\Topic
Uses Phalcon\Contracts\Queue\Topic
Method Summary¶
public
__construct( string $topicName )
GenericTopic constructor.
public
string
getTopicName()
Returns the topic name.
Properties¶
protected
string
$topicName = ""
Methods¶
__construct()¶
GenericTopic constructor.
getTopicName()¶
Returns the topic name.
Queue\Adapter\Memory\MemoryConnectionFactory¶
Class Source on GitHub
Builds a MemoryContext. The Memory transport takes no options.
Phalcon\Queue\Adapter\Memory\MemoryConnectionFactory- implementsPhalcon\Contracts\Queue\ConnectionFactory
Uses Phalcon\Contracts\Queue\ConnectionFactory · Phalcon\Contracts\Queue\Context
Method Summary¶
public
__construct( array $options = [] )
MemoryConnectionFactory constructor.
public
ContextInterface
createContext()
Creates a new in-process context.
Properties¶
protected
array
$options = []
Methods¶
__construct()¶
MemoryConnectionFactory constructor.
createContext()¶
Creates a new in-process context.
Queue\Adapter\Memory\MemoryConsumer¶
Class Source on GitHub
Receives messages from a single in-process queue. receive() is the
polling loop inherited from AbstractConsumer.
Phalcon\Queue\Adapter\AbstractConsumerPhalcon\Queue\Adapter\Memory\MemoryConsumer
Uses Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Queue · Phalcon\Queue\Adapter\AbstractConsumer
Method Summary¶
public
__construct(MemoryContext $context,QueueInterface $queue)
MemoryConsumer constructor.
public
void
acknowledge( MessageInterface $message )
No-op: a received message has already been removed from the queue.
public
MessageInterface|null
receiveNoWait()
Removes and returns the next message, or null when the queue is empty.
public
void
reject(MessageInterface $message,bool $requeue = false)
Rejects the message. When requeue is true it is put back on the queue.
Properties¶
protected
MemoryContext
$context
Methods¶
__construct()¶
MemoryConsumer constructor.
acknowledge()¶
No-op: a received message has already been removed from the queue.
receiveNoWait()¶
Removes and returns the next message, or null when the queue is empty.
reject()¶
Rejects the message. When requeue is true it is put back on the queue.
Queue\Adapter\Memory\MemoryContext¶
Class Source on GitHub
In-process transport session. Owns the named FIFO queues that this context's producers and consumers share. The destination factories (createQueue / createTopic / createTemporaryQueue) come from AbstractContext.
Phalcon\Queue\Adapter\AbstractContextPhalcon\Queue\Adapter\Memory\MemoryContext
Uses Phalcon\Contracts\Queue\Consumer · Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Producer · Phalcon\Contracts\Queue\Queue · Phalcon\Contracts\Queue\SubscriptionConsumer · Phalcon\Queue\Adapter\AbstractContext · Phalcon\Queue\Adapter\QueueDestinationGuard
Method Summary¶
public
void
close()
Closes the context and drops every stored message.
public
ConsumerInterface
createConsumer( DestinationInterface $destination )
Creates a consumer for the given queue destination.
public
MessageInterface
createMessage(string $body = "",array $properties = [],array $headers = [])
Creates a message.
public
ProducerInterface
createProducer()
Creates a producer.
public
SubscriptionConsumerInterface
createSubscriptionConsumer()
Creates a subscription consumer.
public
MessageInterface|null
popMessage( string $queueName )
Removes the front message from a queue, or null when it is empty.
public
void
purgeQueue( QueueInterface $queue )
Removes all messages from the given queue.
public
void
pushMessage(string $queueName,MessageInterface $message)
Appends a message to the back of a queue.
Properties¶
protected
array
$queues = []
Named queues: queue name => list of messages (FIFO).
Methods¶
close()¶
Closes the context and drops every stored message.
createConsumer()¶
Creates a consumer for the given queue destination.
createMessage()¶
public function createMessage(
string $body = "",
array $properties = [],
array $headers = []
): MessageInterface;
Creates a message.
createProducer()¶
Creates a producer.
createSubscriptionConsumer()¶
Creates a subscription consumer.
popMessage()¶
Removes the front message from a queue, or null when it is empty. Internal transport API used by MemoryConsumer.
purgeQueue()¶
Removes all messages from the given queue.
pushMessage()¶
Appends a message to the back of a queue. Internal transport API used by MemoryProducer.
Queue\Adapter\Memory\MemoryMessage¶
Class Source on GitHub
In-process message. All behavior comes from MessageTrait.
Phalcon\Queue\Adapter\AbstractMessagePhalcon\Queue\Adapter\Memory\MemoryMessage
Uses Phalcon\Queue\Adapter\AbstractMessage
Queue\Adapter\Memory\MemoryProducer¶
Class Source on GitHub
Sends messages into an in-process queue. The Memory transport delivers immediately and in-process, so delivery delay, priority and time to live are not supported (the defaults from AbstractProducer reject them).
Phalcon\Queue\Adapter\AbstractProducerPhalcon\Queue\Adapter\Memory\MemoryProducer
Uses Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Message · Phalcon\Queue\Adapter\AbstractProducer · Phalcon\Queue\Adapter\QueueDestinationGuard
Method Summary¶
public
__construct( MemoryContext $context )
public
void
send(DestinationInterface $destination,MessageInterface $message)
Properties¶
protected
MemoryContext
$context
Methods¶
__construct()¶
send()¶
Queue\Adapter\Memory\MemorySubscriptionConsumer¶
Class Source on GitHub
Consumes from several in-process queues at once. The round-robin poll loop lives in SubscriptionConsumerTrait.
Phalcon\Queue\Adapter\AbstractSubscriptionConsumerPhalcon\Queue\Adapter\Memory\MemorySubscriptionConsumer
Uses Phalcon\Queue\Adapter\AbstractSubscriptionConsumer
Method Summary¶
Properties¶
protected
MemoryContext
$context
Retained for transports that may later need it for a native multi-queue
receive; the shared poll loop does not use it.
Methods¶
__construct()¶
Queue\Adapter\MessageEnvelope¶
Class Source on GitHub
Encodes and decodes the {body, properties, headers} envelope shared by every
transport that persists a message as a serialized string (Stream, Redis,
Beanstalk). Centralizes the wire shape, the object-injection-safe
allowed_classes => false guard, and the missing-key defaults, so each
adapter only supplies its own concrete message factory around decode().
Phalcon\Queue\Adapter\MessageEnvelope
Uses Phalcon\Contracts\Queue\Message
Method Summary¶
public
array|null
decode( string $payload )
Decodes a serialized payload into a normalized {body, properties,
public
string
encode( MessageInterface $message )
Serializes a message into its wire envelope.
Methods¶
decode()¶
Decodes a serialized payload into a normalized {body, properties, headers} array, or null when the payload is not a valid envelope.
encode()¶
Serializes a message into its wire envelope.
Queue\Adapter\QueueDestinationGuard¶
Class Source on GitHub
Shared "destination must be a queue" guard. Producers (on send) and contexts
(on createConsumer) both reject any non-queue destination with the same typed
exception; this keeps that single rule in one place. The action verb
("send to", "consume from") tailors the message to the caller.
Phalcon\Queue\Adapter\QueueDestinationGuard
Uses Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Queue · Phalcon\Queue\Exceptions\InvalidDestinationException
Method Summary¶
Methods¶
assertQueue()¶
Throws InvalidDestinationException unless the destination is a queue.
Queue\Adapter\Redis\RedisConnectionFactory¶
Class Source on GitHub
Connects to a Redis server (ext-redis) and builds a RedisContext. The connection (connect/pconnect, auth, database select) is delegated to Phalcon\Storage\Adapter\Redis so the queue reuses the framework's hardened connection handling instead of re-implementing it.
Options: - host: server host (default 127.0.0.1). - port: server port (default 6379). - timeout: connection timeout in seconds (default 0). - persistent: use a persistent connection (default false). - persistentId: identifier for the persistent connection. - auth: password, or [user, password] for ACL auth. - index: database index to SELECT (default 0). - prefix: key prefix for every queue (default "phalcon_queue:"). - pollInterval: milliseconds between subscription poll passes (default 200).
Phalcon\Queue\Adapter\Redis\RedisConnectionFactory- implementsPhalcon\Contracts\Queue\ConnectionFactory
Uses Phalcon\Contracts\Queue\ConnectionFactory · Phalcon\Contracts\Queue\Context · Phalcon\Queue\Exceptions\Exception · Phalcon\Storage\Adapter\Redis · Phalcon\Storage\Exception · Phalcon\Storage\SerializerFactory
Method Summary¶
Properties¶
protected
array
$options = []
Methods¶
__construct()¶
createContext()¶
Queue\Adapter\Redis\RedisConsumer¶
Class Source on GitHub
Receives messages from a single Redis queue. receive() is overridden to
use the native blocking BRPOP (in one-second chunks, so due delayed
messages keep getting promoted) instead of the inherited polling loop.
Phalcon\Queue\Adapter\AbstractConsumerPhalcon\Queue\Adapter\Redis\RedisConsumer
Uses Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Queue · Phalcon\Queue\Adapter\AbstractConsumer
Method Summary¶
public
__construct(RedisContext $context,QueueInterface $queue)
public
void
acknowledge( MessageInterface $message )
No-op: a received message has already been removed from the queue.
public
MessageInterface|null
receive( int $timeout = 0 )
public
MessageInterface|null
receiveNoWait()
public
void
reject(MessageInterface $message,bool $requeue = false)
Properties¶
protected
RedisContext
$context
Methods¶
__construct()¶
acknowledge()¶
No-op: a received message has already been removed from the queue.
receive()¶
receiveNoWait()¶
reject()¶
Queue\Adapter\Redis\RedisContext¶
Class Source on GitHub
Redis transport session (ext-redis). Each queue is a Redis list; messages
are LPUSHed on send and RPOP/BRPOPed on receive, giving FIFO delivery.
Delayed messages live in a companion sorted set (<key>:delayed) scored by
their due time in milliseconds, and are promoted into the list once due. The
destination factories come from AbstractContext.
Phalcon\Queue\Adapter\AbstractContextPhalcon\Queue\Adapter\Redis\RedisContext
Uses Phalcon\Contracts\Queue\Consumer · Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Producer · Phalcon\Contracts\Queue\Queue · Phalcon\Contracts\Queue\SubscriptionConsumer · Phalcon\Queue\Adapter\AbstractContext · Phalcon\Queue\Adapter\MessageEnvelope · Phalcon\Queue\Adapter\QueueDestinationGuard
Method Summary¶
public
__construct(mixed $redis,string $prefix = "phalcon_queue:",int $pollInterval = 200)
public
MessageInterface|null
blockingPop(string $queueName,int $timeout)
Blocking pop from the back of a queue list. Promotes any due delayed
public
void
close()
public
ConsumerInterface
createConsumer( DestinationInterface $destination )
public
MessageInterface
createMessage(string $body = "",array $properties = [],array $headers = [])
public
ProducerInterface
createProducer()
public
SubscriptionConsumerInterface
createSubscriptionConsumer()
public
MessageInterface|null
popMessage( string $queueName )
Non-blocking pop from the back of a queue list, or null when empty.
public
void
purgeQueue( QueueInterface $queue )
public
void
pushMessage(string $queueName,MessageInterface $message,int $delay = 0)
Sends a message to a queue. With a positive delay (milliseconds) the
Properties¶
protected
int
$pollInterval = 200
Milliseconds slept between poll passes by a subscription consumer.
protected
string
$prefix = "phalcon_queue:"
Key prefix applied to every queue (and its delayed companion set).
protected
\Redis
$redis
The connected ext-redis client.
Methods¶
__construct()¶
public function __construct(
mixed $redis,
string $prefix = "phalcon_queue:",
int $pollInterval = 200
);
blockingPop()¶
Blocking pop from the back of a queue list. Promotes any due delayed messages first, then blocks up to timeout seconds. Internal transport API used by RedisConsumer.
close()¶
createConsumer()¶
createMessage()¶
public function createMessage(
string $body = "",
array $properties = [],
array $headers = []
): MessageInterface;
createProducer()¶
createSubscriptionConsumer()¶
popMessage()¶
Non-blocking pop from the back of a queue list, or null when empty. Promotes any due delayed messages first. Internal transport API used by RedisConsumer.
purgeQueue()¶
pushMessage()¶
Sends a message to a queue. With a positive delay (milliseconds) the message is parked in the delayed set; otherwise it is pushed onto the front of the list. Internal transport API used by RedisProducer.
Queue\Adapter\Redis\RedisMessage¶
Class Source on GitHub
Redis-backed message. All behavior comes from MessageTrait.
Phalcon\Queue\Adapter\AbstractMessagePhalcon\Queue\Adapter\Redis\RedisMessage
Uses Phalcon\Queue\Adapter\AbstractMessage
Queue\Adapter\Redis\RedisProducer¶
Class Source on GitHub
Sends messages to a Redis queue. Delivery delay is supported (via the delayed sorted set); priority and time to live are not (the defaults from AbstractProducer reject them).
Phalcon\Queue\Adapter\AbstractProducerPhalcon\Queue\Adapter\Redis\RedisProducer
Uses Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Producer · Phalcon\Queue\Adapter\AbstractProducer · Phalcon\Queue\Adapter\QueueDestinationGuard
Method Summary¶
public
__construct( RedisContext $context )
public
int|null
getDeliveryDelay()
public
void
send(DestinationInterface $destination,MessageInterface $message)
public
ProducerInterface
setDeliveryDelay( mixed $deliveryDelay = null )
Properties¶
protected
RedisContext
$context
protected
int | null
$deliveryDelay = null
Delivery delay in milliseconds, or null when not set.
Methods¶
__construct()¶
getDeliveryDelay()¶
send()¶
setDeliveryDelay()¶
Queue\Adapter\Redis\RedisSubscriptionConsumer¶
Class Source on GitHub
Consumes from several Redis queues at once. The round-robin poll loop lives in SubscriptionConsumerTrait.
Phalcon\Queue\Adapter\AbstractSubscriptionConsumerPhalcon\Queue\Adapter\Redis\RedisSubscriptionConsumer
Uses Phalcon\Queue\Adapter\AbstractSubscriptionConsumer
Method Summary¶
Properties¶
protected
RedisContext
$context
Retained for transports that may later need it for a native multi-queue
receive; the shared poll loop does not use it.
Methods¶
__construct()¶
Queue\Adapter\Stream\StreamConnectionFactory¶
Class Source on GitHub
Builds a StreamContext.
Options: - storageDir: directory holding the queue files (default: system temp). - pollInterval: milliseconds between consumer poll attempts (default 200).
Phalcon\Queue\Adapter\Stream\StreamConnectionFactory- implementsPhalcon\Contracts\Queue\ConnectionFactory
Uses Phalcon\Contracts\Queue\ConnectionFactory · Phalcon\Contracts\Queue\Context
Method Summary¶
Properties¶
protected
array
$options = []
Methods¶
__construct()¶
createContext()¶
Queue\Adapter\Stream\StreamConsumer¶
Class Source on GitHub
Receives messages from a single filesystem queue. receive() is the
polling loop inherited from AbstractConsumer.
Phalcon\Queue\Adapter\AbstractConsumerPhalcon\Queue\Adapter\Stream\StreamConsumer
Uses Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Queue · Phalcon\Queue\Adapter\AbstractConsumer
Method Summary¶
public
__construct(StreamContext $context,QueueInterface $queue,int $pollInterval = 200)
public
void
acknowledge( MessageInterface $message )
No-op: a received message has already been removed from the queue file.
public
MessageInterface|null
receiveNoWait()
public
void
reject(MessageInterface $message,bool $requeue = false)
Properties¶
protected
StreamContext
$context
Methods¶
__construct()¶
public function __construct(
StreamContext $context,
QueueInterface $queue,
int $pollInterval = 200
);
acknowledge()¶
No-op: a received message has already been removed from the queue file.
receiveNoWait()¶
reject()¶
Queue\Adapter\Stream\StreamContext¶
Class Source on GitHub
Filesystem transport session. Each queue is one append-only file under the configured directory; cross-process safety comes from flock. One message per line, stored as base64(serialize([...])) so bodies with newlines are safe. The destination factories come from AbstractContext.
Phalcon\Queue\Adapter\AbstractContextPhalcon\Queue\Adapter\Stream\StreamContext
Uses Phalcon\Contracts\Queue\Consumer · Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Producer · Phalcon\Contracts\Queue\Queue · Phalcon\Contracts\Queue\SubscriptionConsumer · Phalcon\Queue\Adapter\AbstractContext · Phalcon\Queue\Adapter\MessageEnvelope · Phalcon\Queue\Adapter\QueueDestinationGuard · Phalcon\Traits\Php\FileTrait
Method Summary¶
public
__construct(string $storageDir,int $pollInterval = 200)
public
void
close()
public
ConsumerInterface
createConsumer( DestinationInterface $destination )
public
MessageInterface
createMessage(string $body = "",array $properties = [],array $headers = [])
public
ProducerInterface
createProducer()
public
SubscriptionConsumerInterface
createSubscriptionConsumer()
public
MessageInterface|null
popMessage( string $queueName )
Removes the front message from a queue file, or null when it is empty.
public
void
purgeQueue( QueueInterface $queue )
public
void
pushMessage(string $queueName,MessageInterface $message)
Appends a message to the back of a queue file.
Properties¶
protected
int
$pollInterval = 200
Milliseconds slept between poll attempts by consumers.
protected
string
$storageDir = ""
Directory (with trailing separator) that holds the queue files.
Methods¶
__construct()¶
close()¶
createConsumer()¶
createMessage()¶
public function createMessage(
string $body = "",
array $properties = [],
array $headers = []
): MessageInterface;
createProducer()¶
createSubscriptionConsumer()¶
popMessage()¶
Removes the front message from a queue file, or null when it is empty. Internal transport API used by StreamConsumer.
purgeQueue()¶
pushMessage()¶
Appends a message to the back of a queue file. Internal transport API used by StreamProducer.
Queue\Adapter\Stream\StreamMessage¶
Class Source on GitHub
Filesystem-backed message. All behavior comes from MessageTrait.
Phalcon\Queue\Adapter\AbstractMessagePhalcon\Queue\Adapter\Stream\StreamMessage
Uses Phalcon\Queue\Adapter\AbstractMessage
Queue\Adapter\Stream\StreamProducer¶
Class Source on GitHub
Appends messages to a filesystem queue. The Stream transport delivers in insertion order with no scheduling, so delivery delay, priority and time to live are not supported (the defaults from AbstractProducer reject them).
Phalcon\Queue\Adapter\AbstractProducerPhalcon\Queue\Adapter\Stream\StreamProducer
Uses Phalcon\Contracts\Queue\Destination · Phalcon\Contracts\Queue\Message · Phalcon\Queue\Adapter\AbstractProducer · Phalcon\Queue\Adapter\QueueDestinationGuard
Method Summary¶
public
__construct( StreamContext $context )
public
void
send(DestinationInterface $destination,MessageInterface $message)
Properties¶
protected
StreamContext
$context
Methods¶
__construct()¶
send()¶
Queue\Adapter\Stream\StreamSubscriptionConsumer¶
Class Source on GitHub
Consumes from several filesystem queues at once. The round-robin poll loop lives in SubscriptionConsumerTrait.
Phalcon\Queue\Adapter\AbstractSubscriptionConsumerPhalcon\Queue\Adapter\Stream\StreamSubscriptionConsumer
Uses Phalcon\Queue\Adapter\AbstractSubscriptionConsumer
Method Summary¶
Properties¶
protected
StreamContext
$context
Retained for transports that may later need it for a native multi-queue
receive; the shared poll loop does not use it.
Methods¶
__construct()¶
Queue\Cli\ConsumerTask¶
Class Source on GitHub
Optional CLI runner for a queue worker - the only class coupled to
Phalcon\Cli. A thin adapter: it resolves the context from the queueFactory
service, binds one queue to one processor (both given as command arguments),
and runs a Worker whose lifetime bounds come from CLI options. Users not on
Phalcon\Cli use Worker directly.
Usage:
Register it in your own Phalcon\Cli\Console; it is not auto-wired into FactoryDefault.
stdClassPhalcon\Di\InjectablePhalcon\Cli\TaskPhalcon\Queue\Cli\ConsumerTask
Uses Phalcon\Cli\Task · Phalcon\Di\DiInterface · Phalcon\Queue\Consumer\QueueConsumer · Phalcon\Queue\Consumer\Worker · Phalcon\Queue\Consumer\WorkerOptions
Method Summary¶
Methods¶
mainAction()¶
Queue\Consumer\BoundProcessor¶
Class Source on GitHub
Binds a processor to a queue, together with the consumer that reads it.
Phalcon\Queue\Consumer\BoundProcessor
Uses Phalcon\Contracts\Queue\Consumer · Phalcon\Contracts\Queue\Processor · Phalcon\Contracts\Queue\Queue
Method Summary¶
public
__construct(QueueInterface $queue,ProcessorInterface $processor,ConsumerInterface $consumer)
public
ConsumerInterface
getConsumer()
public
ProcessorInterface
getProcessor()
public
QueueInterface
getQueue()
Properties¶
protected
ConsumerInterface
$consumer
protected
ProcessorInterface
$processor
protected
QueueInterface
$queue
Methods¶
__construct()¶
public function __construct(
QueueInterface $queue,
ProcessorInterface $processor,
ConsumerInterface $consumer
);
getConsumer()¶
getProcessor()¶
getQueue()¶
Queue\Consumer\Events¶
Class Source on GitHub
Lifecycle event names fired by the queue consumer through Phalcon\Events\Manager. One public constant per event.
Phalcon\Queue\Consumer\Events
Constants¶
string
AFTER_END = "queue:afterEnd"
string
AFTER_PROCESS = "queue:afterProcess"
string
AFTER_RECEIVE = "queue:afterReceive"
string
BEFORE_PROCESS = "queue:beforeProcess"
string
BEFORE_RECEIVE = "queue:beforeReceive"
string
BEFORE_START = "queue:beforeStart"
string
PROCESSOR_EXCEPTION = "queue:processorException"
Queue\Consumer\QueueConsumer¶
Class Source on GitHub
Lean consumption runner. Binds processors to queues, polls each bound queue
round-robin, and dispatches messages to their processors while firing the
lifecycle events on Phalcon\Queue\Consumer\Events through the events
manager. The long-running operational shell (lifetime, signals) lives in
Phalcon\Queue\Consumer\Worker, which drives consumeOnce() and shares the
stop signal through stop() / isStopRequested().
Phalcon\Events\AbstractEventsAwarePhalcon\Queue\Consumer\QueueConsumer- implementsPhalcon\Events\EventsAwareInterface
Uses Phalcon\Contracts\Queue\Context · Phalcon\Contracts\Queue\Message · Phalcon\Contracts\Queue\Processor · Phalcon\Contracts\Queue\Queue · Phalcon\Events\AbstractEventsAware · Phalcon\Events\EventsAwareInterface
Method Summary¶
public
__construct( ContextInterface $context )
public
QueueConsumer
bind(QueueInterface $queue,ProcessorInterface $processor)
Binds a processor to a queue. Returns self for chaining.
public
void
consume( int $timeout = 0 )
Runs the consumption loop, blocking up to timeout milliseconds (0 =
public
bool
consumeOnce()
Polls every bound queue once, processing up to one message from each.
public
void
end()
Fires the queue:afterEnd event. Called once the loop exits.
public
bool
isStopRequested()
Whether a stop has been requested (by a signal, stop(), or an
public
void
setPollInterval( int $pollInterval )
Sets the poll interval (in milliseconds).
public
bool
start()
Resets the stop flag and fires queue:beforeStart. Returns false when a
public
void
stop()
Requests the consumption loop to stop after the current message.
Properties¶
protected
array
$bindings = []
Bound processors keyed by queue name.
protected
ContextInterface
$context
protected
int
$pollInterval = 200
Milliseconds slept between poll passes when nothing was received.
protected
bool
$shouldStop = false
Methods¶
__construct()¶
bind()¶
Binds a processor to a queue. Returns self for chaining.
consume()¶
Runs the consumption loop, blocking up to timeout milliseconds (0 = block until stopped). The simple loop; production setups use Worker.
consumeOnce()¶
Polls every bound queue once, processing up to one message from each. Returns true if any message was handled. Sleeps the poll interval when nothing was received so callers can loop tightly.
end()¶
Fires the queue:afterEnd event. Called once the loop exits.
isStopRequested()¶
Whether a stop has been requested (by a signal, stop(), or an
afterReceive listener returning false).
setPollInterval()¶
Sets the poll interval (in milliseconds).
start()¶
Resets the stop flag and fires queue:beforeStart. Returns false when a
listener cancels the start.
stop()¶
Requests the consumption loop to stop after the current message.
Queue\Consumer\Worker¶
Class Source on GitHub
Long-running operational shell around a QueueConsumer. Owns the outer loop, the bounded lifetime (max messages / seconds / memory, plus jitter) and - when ext-pcntl is available - graceful shutdown on SIGTERM/SIGINT/SIGQUIT. The current message always finishes before the loop stops (drain, not guillotine), because the stop flag is only checked between iterations.
Phalcon\Queue\Consumer\Worker
Uses Phalcon\Traits\Php\InfoTrait
Method Summary¶
public
__construct(QueueConsumer $consumer,WorkerOptions $options = null)
public
void
handleSignal( int $signal )
Signal handler: requests a graceful stop.
public
int
run()
Runs the worker until a lifetime bound trips or a stop is requested.
Properties¶
protected
QueueConsumer
$consumer
protected
WorkerOptions
$options
Methods¶
__construct()¶
handleSignal()¶
Signal handler: requests a graceful stop.
run()¶
Runs the worker until a lifetime bound trips or a stop is requested. Returns the number of messages processed.
Queue\Consumer\WorkerOptions¶
Class Source on GitHub
Immutable lifetime bounds for a Worker. A value of 0 means "no limit". The worker stops on whichever bound trips first.
Phalcon\Queue\Consumer\WorkerOptions
Method Summary¶
public
__construct(int $maxMessages = 0,int $maxSeconds = 0,int $maxMemory = 0,int $jitter = 0)
public
int
getJitter()
public
int
getMaxMemory()
public
int
getMaxMessages()
public
int
getMaxSeconds()
Properties¶
protected
int
$jitter = 0
Seconds added to maxSeconds (randomised per worker) so a pool does not
restart in lockstep.
protected
int
$maxMemory = 0
Memory ceiling in megabytes.
protected
int
$maxMessages = 0
Maximum number of messages to process.
protected
int
$maxSeconds = 0
Maximum run time in seconds.
Methods¶
__construct()¶
public function __construct(
int $maxMessages = 0,
int $maxSeconds = 0,
int $maxMemory = 0,
int $jitter = 0
);
getJitter()¶
getMaxMemory()¶
getMaxMessages()¶
getMaxSeconds()¶
Queue\Exceptions\DeliveryDelayNotSupportedException¶
Class Source on GitHub
Thrown when the transport does not support a delivery delay.
BaseExceptionPhalcon\Queue\Exceptions\ExceptionPhalcon\Queue\Exceptions\DeliveryDelayNotSupportedException
Method Summary¶
Methods¶
__construct()¶
Queue\Exceptions\Exception¶
Class Source on GitHub
Generic exception for the Queue component, and the base for every typed queue exception.
BaseExceptionPhalcon\Queue\Exceptions\Exception- implementsPhalcon\Queue\Exceptions\QueueThrowablePhalcon\Queue\Exceptions\DeliveryDelayNotSupportedExceptionPhalcon\Queue\Exceptions\InvalidDestinationExceptionPhalcon\Queue\Exceptions\InvalidMessageExceptionPhalcon\Queue\Exceptions\PriorityNotSupportedExceptionPhalcon\Queue\Exceptions\PurgeQueueNotSupportedExceptionPhalcon\Queue\Exceptions\SubscriptionConsumerNotSupportedExceptionPhalcon\Queue\Exceptions\TemporaryQueueNotSupportedExceptionPhalcon\Queue\Exceptions\TimeToLiveNotSupportedException
Uses Exception
Queue\Exceptions\InvalidDestinationException¶
Class Source on GitHub
Thrown when a destination is not valid for the operation, for example a Topic passed where a Queue is required. The action verb ("send to", "consume from") tailors the message to the failing operation.
BaseExceptionPhalcon\Queue\Exceptions\ExceptionPhalcon\Queue\Exceptions\InvalidDestinationException
Method Summary¶
Methods¶
__construct()¶
Queue\Exceptions\InvalidMessageException¶
Class Source on GitHub
Thrown when a message is not valid for the operation.
BaseExceptionPhalcon\Queue\Exceptions\ExceptionPhalcon\Queue\Exceptions\InvalidMessageException
Method Summary¶
Methods¶
__construct()¶
Queue\Exceptions\PriorityNotSupportedException¶
Class Source on GitHub
Thrown when the transport does not support message priority.
BaseExceptionPhalcon\Queue\Exceptions\ExceptionPhalcon\Queue\Exceptions\PriorityNotSupportedException
Method Summary¶
Methods¶
__construct()¶
Queue\Exceptions\PurgeQueueNotSupportedException¶
Class Source on GitHub
Thrown when the transport does not support purging a queue.
BaseExceptionPhalcon\Queue\Exceptions\ExceptionPhalcon\Queue\Exceptions\PurgeQueueNotSupportedException
Method Summary¶
Methods¶
__construct()¶
Queue\Exceptions\QueueThrowable¶
Interface Source on GitHub
Base throwable contract for the Queue component. Every queue exception implements it, so callers can catch all queue errors with a single type.
\ThrowablePhalcon\Queue\Exceptions\QueueThrowable
Queue\Exceptions\SubscriptionConsumerNotSupportedException¶
Class Source on GitHub
Thrown when the transport does not support subscription consumers.
BaseExceptionPhalcon\Queue\Exceptions\ExceptionPhalcon\Queue\Exceptions\SubscriptionConsumerNotSupportedException
Method Summary¶
Methods¶
__construct()¶
Queue\Exceptions\TemporaryQueueNotSupportedException¶
Class Source on GitHub
Thrown when the transport does not support temporary queues.
BaseExceptionPhalcon\Queue\Exceptions\ExceptionPhalcon\Queue\Exceptions\TemporaryQueueNotSupportedException
Method Summary¶
Methods¶
__construct()¶
Queue\Exceptions\TimeToLiveNotSupportedException¶
Class Source on GitHub
Thrown when the transport does not support a message time to live.
BaseExceptionPhalcon\Queue\Exceptions\ExceptionPhalcon\Queue\Exceptions\TimeToLiveNotSupportedException
Method Summary¶
Methods¶
__construct()¶
Queue\QueueFactory¶
Class Source on GitHub
Builds a queue Context from the standard Phalcon config shape. Mirrors Phalcon\Cache\CacheFactory.
Phalcon\Factory\AbstractConfigFactoryPhalcon\Queue\QueueFactory
Uses Phalcon\Contracts\Queue\Context · Phalcon\Factory\AbstractConfigFactory
Method Summary¶
public
__construct( AdapterFactory $factory = null )
QueueFactory constructor. A default AdapterFactory is created when none
public
ContextInterface
load( mixed $config )
Builds a Context from a config array/object.
public
ContextInterface
newInstance(string $name,array $options = [])
Builds a Context for the named adapter.
protected
string
getExceptionClass()
Properties¶
protected
AdapterFactory
$adapterFactory
Methods¶
__construct()¶
QueueFactory constructor. A default AdapterFactory is created when none is supplied, so the factory is usable straight from the DI container.
load()¶
Builds a Context from a config array/object.
newInstance()¶
Builds a Context for the named adapter.