0

Interface Yiisoft\Queue\QueueConsumerInterface

Implemented byYiisoft\Queue\Debug\QueueConsumerDecorator, Yiisoft\Queue\QueueConsumer, Yiisoft\Queue\Stubs\StubQueueConsumer

Consumes messages from a queue.

This interface complements {@see \Yiisoft\Queue\QueueProducerInterface}, which produces messages and checks their status.

Public Methods

Hide inherited methods

Method Description Defined By
listen() Listen to the queue and handle messages as they come. Yiisoft\Queue\QueueConsumerInterface
run() Handle all existing messages and exit. Yiisoft\Queue\QueueConsumerInterface

Method Details

Hide inherited methods

listen() public abstract method

Listen to the queue and handle messages as they come.

public abstract void listen ( )

                public function listen(): void;

            
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;