0 follower

Interface Yiisoft\Queue\QueueInterface

Implemented byYiisoft\Queue\Debug\QueueDecorator, Yiisoft\Queue\Queue, Yiisoft\Queue\Stubs\StubQueue

Public Methods

Hide inherited 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

Hide inherited methods

getName() public abstract method

Returns the logical name of the queue.

public abstract string getName ( )

                public function getName(): string;

            
listen() public abstract method

Listen to the queue and handle messages as they come

public abstract void listen ( )

                public function listen(): void;

            
push() public abstract method

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;

            
run() public abstract method

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;

            
status() public abstract method

public abstract \Yiisoft\Queue\MessageStatus status ( integer|string $id )
$id integer|string

A message ID.

                public function status(string|int $id): MessageStatus;

            
withMiddlewares() public abstract method

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;

            
withMiddlewaresAdded() public abstract method

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;