Interface Yiisoft\Queue\QueueInterface
| Implemented by | Yiisoft\Queue\Debug\QueueDecorator, Yiisoft\Queue\Queue, Yiisoft\Queue\Stubs\StubQueue |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getName() | Returns the logical name of the queue. | Yiisoft\Queue\QueueInterface |
| listen() | Listen to the queue and handle messages as they come | Yiisoft\Queue\QueueInterface |
| push() | Pushes a message into the queue. | Yiisoft\Queue\QueueInterface |
| run() | Handle all existing messages and exit | Yiisoft\Queue\QueueInterface |
| status() | Yiisoft\Queue\QueueInterface | |
| withMiddlewares() | Creates a new instance with the specified middlewares. All the existing middlewares are replaced. | Yiisoft\Queue\QueueInterface |
| withMiddlewaresAdded() | Creates a new instance with the specified middlewares added after the existing ones. | Yiisoft\Queue\QueueInterface |
Method Details
Returns the logical name of the queue.
| public abstract string getName ( ) |
public function getName(): string;
Listen to the queue and handle messages as they come
| public abstract void listen ( ) |
public function listen(): void;
Pushes a message into the queue.
| public abstract Yiisoft\Queue\Message\MessageInterface push ( Yiisoft\Queue\Message\MessageInterface $message ) | ||
| $message | Yiisoft\Queue\Message\MessageInterface |
The message to push. |
| return | Yiisoft\Queue\Message\MessageInterface |
The pushed message, possibly enriched with metadata such as an assigned ID. |
|---|---|---|
public function push(MessageInterface $message): MessageInterface;
Handle all existing messages and exit
| public abstract integer run ( integer $max = 0 ) | ||
| $max | integer | |
| return | integer |
Number of messages processed. |
|---|---|---|
public function run(int $max = 0): int;
| public abstract \Yiisoft\Queue\MessageStatus status ( integer|string $id ) | ||
| $id | integer|string |
A message ID. |
public function status(string|int $id): MessageStatus;
Creates a new instance with the specified middlewares. All the existing middlewares are replaced.
| public abstract self withMiddlewares ( mixed $middlewareDefinitions ) | ||
| $middlewareDefinitions | mixed |
The middleware definitions. |
public function withMiddlewares(mixed ...$middlewareDefinitions): self;
Creates a new instance with the specified middlewares added after the existing ones.
| public abstract self withMiddlewaresAdded ( mixed $middlewareDefinitions ) | ||
| $middlewareDefinitions | mixed |
The middleware definitions. |
public function withMiddlewaresAdded(mixed ...$middlewareDefinitions): self;
Signup or Login in order to comment.