1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
QueueConfig.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
15
17{
18 public function __construct(
19 public readonly string $queueId,
20 public readonly string $handler,
21 public readonly string $moduleId,
22 public readonly ?string $brokerCode,
23 public readonly RetryStrategyInterface $retryStrategy
24 )
25 {
26 }
27
33 public function createReceiver(): ReceiverInterface
34 {
35 Loader::requireModule($this->moduleId);
36
37 if (!class_exists($this->handler))
38 {
39 throw new ConfigurationException(
40 sprintf('The class "%s" does not exist', $this->handler)
41 );
42 }
43
44 if (!is_subclass_of($this->handler, ReceiverInterface::class))
45 {
46 throw new ConfigurationException(
47 sprintf('The class "%s" does not implement "%s"', $this->handler, ReceiverInterface::class)
48 );
49 }
50
51 $brokerManager = ServiceLocator::getInstance()->get(BrokerManager::class);
52
54 $receiver = ServiceLocator::getInstance()->get($this->handler);
55
56 $receiver
57 ->setQueueId($this->queueId)
58 ->setBroker($brokerManager->getBroker($this->queueId))
59 ;
60
61 return $receiver;
62 }
63}
Определения loader.php:13
static requireModule($moduleName)
Определения loader.php:174
__construct(public readonly string $queueId, public readonly string $handler, public readonly string $moduleId, public readonly ?string $brokerCode, public readonly RetryStrategyInterface $retryStrategy)
Определения QueueConfig.php:18
$moduleId