0 follower

Final Class Yiisoft\Queue\Provider\PrototypeQueueProvider

InheritanceYiisoft\Queue\Provider\PrototypeQueueProvider
ImplementsYiisoft\Queue\Provider\QueueProviderInterface

Queue provider that only changes the channel name of the base queue.

It can be useful when your queues used the same adapter.

Constants

Hide inherited constants

Constant Value Description Defined By
DEFAULT_CHANNEL 'yii-queue' Yiisoft\Queue\Provider\QueueProviderInterface

Method Details

Hide inherited methods

__construct() public method

public __construct( Yiisoft\Queue\QueueInterface $baseQueue, Yiisoft\Queue\Adapter\AdapterInterface $baseAdapter ): mixed
$baseQueue Yiisoft\Queue\QueueInterface

Base queue to use for creating queues.

$baseAdapter Yiisoft\Queue\Adapter\AdapterInterface

                public function __construct(
    private readonly QueueInterface $baseQueue,
    private readonly AdapterInterface $baseAdapter,
) {}

            
get() public method

public get( string|\BackedEnum $channel ): Yiisoft\Queue\QueueInterface
$channel string|\BackedEnum

                public function get(string|BackedEnum $channel): QueueInterface
{
    return $this->baseQueue->withAdapter($this->baseAdapter->withChannel($channel));
}

            
has() public method

public has( string|\BackedEnum $channel ): boolean
$channel string|\BackedEnum

                public function has(string|BackedEnum $channel): bool
{
    return true;
}