0 follower

Final Class Yiisoft\Queue\Provider\CompositeQueueProvider

InheritanceYiisoft\Queue\Provider\CompositeQueueProvider
ImplementsYiisoft\Queue\Provider\QueueProviderInterface

Composite queue provider.

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\Provider\QueueProviderInterface $providers ): mixed
$providers Yiisoft\Queue\Provider\QueueProviderInterface

Queue providers to use.

                public function __construct(
    QueueProviderInterface ...$providers,
) {
    $this->providers = $providers;
}

            
get() public method

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

                public function get(string|BackedEnum $channel): QueueInterface
{
    foreach ($this->providers as $provider) {
        if ($provider->has($channel)) {
            return $provider->get($channel);
        }
    }
    throw new ChannelNotFoundException($channel);
}

            
has() public method

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

                public function has(string|BackedEnum $channel): bool
{
    foreach ($this->providers as $provider) {
        if ($provider->has($channel)) {
            return true;
        }
    }
    return false;
}