Final Class Yiisoft\Queue\Provider\CompositeQueueProvider
| Inheritance | Yiisoft\Queue\Provider\CompositeQueueProvider |
|---|---|
| Implements | Yiisoft\Queue\Provider\QueueProviderInterface |
Composite queue provider.
Public Methods
Method Details
| 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;
}
| public Yiisoft\Queue\QueueInterface get ( string|\BackedEnum $name ) | ||
| $name | string|\BackedEnum | |
public function get(string|BackedEnum $name): QueueInterface
{
foreach ($this->providers as $provider) {
if ($provider->has($name)) {
return $provider->get($name);
}
}
throw new QueueNotFoundException($name);
}
| public array getNames ( ) |
public function getNames(): array
{
$names = [];
foreach ($this->providers as $provider) {
$names[] = $provider->getNames();
}
return array_values(array_unique(array_merge(...$names)));
}
Signup or Login in order to comment.