0 follower

Final Class Yiisoft\Queue\Provider\CompositeQueueProvider

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

Composite queue provider.

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Queue\Provider\QueueProviderInterface $providers )
$providers Yiisoft\Queue\Provider\QueueProviderInterface

Queue providers to use.

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

            
get() public method

public Yiisoft\Queue\QueueInterface get ( string|\BackedEnum $channel )
$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 boolean has ( string|\BackedEnum $channel )
$channel string|\BackedEnum

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