Final Class Yiisoft\Queue\Provider\AdapterFactoryQueueProvider
| Inheritance | Yiisoft\Queue\Provider\AdapterFactoryQueueProvider |
|---|---|
| Implements | Yiisoft\Queue\Provider\QueueProviderInterface |
This queue provider creates new queue objects based on adapter definitions.
See also:
Public Methods
Method Details
| public mixed __construct ( Yiisoft\Queue\QueueInterface $baseQueue, array $definitions, \Psr\Container\ContainerInterface|null $container = null, boolean $validate = true ) | ||
| $baseQueue | Yiisoft\Queue\QueueInterface |
Base queue for queues creation. |
| $definitions | array |
Adapter definitions indexed by channel names. |
| $container | \Psr\Container\ContainerInterface|null |
Container to use for dependencies resolving. |
| $validate | boolean |
If definitions should be validated when set. |
| throws | Yiisoft\Queue\Provider\InvalidQueueConfigException | |
|---|---|---|
public function __construct(
private readonly QueueInterface $baseQueue,
array $definitions,
?ContainerInterface $container = null,
bool $validate = true,
) {
try {
$this->factory = new StrictFactory($definitions, $container, $validate);
} catch (InvalidConfigException $exception) {
throw new InvalidQueueConfigException($exception->getMessage(), previous: $exception);
}
}
| public Yiisoft\Queue\QueueInterface get ( string|\BackedEnum $channel ) | ||
| $channel | string|\BackedEnum | |
public function get(string|BackedEnum $channel): QueueInterface
{
$channel = ChannelNormalizer::normalize($channel);
$queue = $this->getOrTryToCreate($channel);
if ($queue === null) {
throw new ChannelNotFoundException($channel);
}
return $queue;
}
Signup or Login in order to comment.