0 follower

Final Class Yiisoft\Queue\Debug\QueueDecorator

InheritanceYiisoft\Queue\Debug\QueueDecorator
ImplementsYiisoft\Queue\QueueInterface

Method Details

Hide inherited methods

__construct() public method

public __construct( Yiisoft\Queue\QueueInterface $queue, Yiisoft\Queue\Debug\QueueCollector $collector ): mixed
$queue Yiisoft\Queue\QueueInterface
$collector Yiisoft\Queue\Debug\QueueCollector

                public function __construct(
    private readonly QueueInterface $queue,
    private readonly QueueCollector $collector,
) {}

            
getChannel() public method

public getChannel( ): string

                public function getChannel(): string
{
    return $this->queue->getChannel();
}

            
listen() public method

public listen( ): void

                public function listen(): void
{
    $this->queue->listen();
}

            
push() public method

public push( Yiisoft\Queue\Message\MessageInterface $message, string|array|callable|Yiisoft\Queue\Middleware\Push\MiddlewarePushInterface $middlewareDefinitions ): Yiisoft\Queue\Message\MessageInterface
$message Yiisoft\Queue\Message\MessageInterface
$middlewareDefinitions string|array|callable|Yiisoft\Queue\Middleware\Push\MiddlewarePushInterface

                public function push(
    MessageInterface $message,
    string|array|callable|MiddlewarePushInterface ...$middlewareDefinitions,
): MessageInterface {
    $message = $this->queue->push($message, ...$middlewareDefinitions);
    $this->collector->collectPush($this->queue->getChannel(), $message, ...$middlewareDefinitions);
    return $message;
}

            
run() public method

public run( integer $max 0 ): integer
$max integer

                public function run(int $max = 0): int
{
    return $this->queue->run($max);
}

            
status() public method

public status( string|integer $id ): \Yiisoft\Queue\JobStatus
$id string|integer

                public function status(string|int $id): JobStatus
{
    $result = $this->queue->status($id);
    $this->collector->collectStatus((string) $id, $result);
    return $result;
}

            
withAdapter() public method

public withAdapter( Yiisoft\Queue\Adapter\AdapterInterface $adapter ): Yiisoft\Queue\Debug\QueueDecorator
$adapter Yiisoft\Queue\Adapter\AdapterInterface

                public function withAdapter(AdapterInterface $adapter): static
{
    return new self($this->queue->withAdapter($adapter), $this->collector);
}