Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
eventdelayedsyncrule.php
1
<?php
2
3
namespace
Bitrix\Calendar\Core\Queue\Rule\Rules
;
4
5
use
Bitrix\Calendar\Core\Queue\Queue
;
6
use
Bitrix\Calendar\Core\Queue\Interfaces
;
7
use
Bitrix\Calendar\Core\Queue\Message\Dictionary
;
8
9
class
EventDelayedSyncRule
extends
DbRule
10
{
11
private
const
ROUTING_KEY =
'calendar:update_meeting_status'
;
12
17
protected
function
getTargetQueue
(Interfaces\
Message
$message): ?
Queue
\
Queue
18
{
19
$routingKey = $message->getHeaders()[Dictionary::HEADER_KEYS[
'routingKey'
]] ??
null
;
20
if
($routingKey === self::ROUTING_KEY)
21
{
22
return
(
new
Queue
\
QueueFactory
())->getById(
Queue
\QueueRegistry::QUEUE_LIST[
'EventDelayedSync'
]);
23
}
24
25
return
null
;
26
}
27
32
protected
function
getMessageHash
(Interfaces\
Message
$message): string
33
{
34
return
'calendar_event_'
. $message->getBody()[
'parentId'
];
35
}
36
}
Bitrix\Calendar\Core\Queue\Message\Dictionary
Definition
dictionary.php:6
Bitrix\Calendar\Core\Queue\Queue\QueueFactory
Definition
queuefactory.php:6
Bitrix\Calendar\Core\Queue\Rule\Rules\DbRule
Definition
dbrule.php:12
Bitrix\Calendar\Core\Queue\Rule\Rules\EventDelayedSyncRule
Definition
eventdelayedsyncrule.php:10
Bitrix\Calendar\Core\Queue\Rule\Rules\EventDelayedSyncRule\getMessageHash
getMessageHash(Interfaces\Message $message)
Definition
eventdelayedsyncrule.php:32
Bitrix\Calendar\Core\Queue\Rule\Rules\EventDelayedSyncRule\getTargetQueue
getTargetQueue(Interfaces\Message $message)
Definition
eventdelayedsyncrule.php:17
Bitrix\Calendar\Core\Queue\Interfaces\Message
Definition
message.php:16
Bitrix\Calendar\Core\Queue\Interfaces\Queue
Definition
queue.php:5
Bitrix\Calendar\Core\Queue\Interfaces
Definition
consumer.php:3
Bitrix\Calendar\Core\Queue\Queue
Definition
queue.php:3
Bitrix\Calendar\Core\Queue\Rule\Rules
Definition
dbrule.php:3
modules
calendar
lib
core
queue
rule
rules
eventdelayedsyncrule.php
Создано системой
1.10.0