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.

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Queue\QueueInterface $baseQueue, Yiisoft\Queue\Adapter\AdapterInterface $baseAdapter )
$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 Yiisoft\Queue\QueueInterface get ( string|\BackedEnum $channel )
$channel string|\BackedEnum

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

            
has() public method

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

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