Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
singlethreadstrategy.php
1
<?php
2
3
namespace
Bitrix\Sender\Posting\ThreadStrategy
;
4
5
use Bitrix\Main\Entity\ReferenceField;
6
use
Bitrix\Sender\PostingRecipientTable
;
7
8
class
SingleThreadStrategy
extends
AbstractThreadStrategy
9
{
10
public
const
THREADS_COUNT
= 1;
11
12
protected
function
setFilter
():void
13
{
14
parent::setFilter();
15
$this->filter += [
16
'=POSTING_ID'
=>
$this->postingId
,
17
'@STATUS'
=> [
PostingRecipientTable::SEND_RESULT_NONE
,
PostingRecipientTable::SEND_RESULT_WAIT_ACCEPT
],
18
];
19
}
20
21
protected
function
setRuntime
():void
22
{
23
$this->runtime = [
24
new
ReferenceField(
25
'MAILING_SUB'
,
'Bitrix\\Sender\\MailingSubscriptionTable'
, [
26
'=this.CONTACT_ID'
=>
'ref.CONTACT_ID'
,
27
'=this.POSTING.MAILING_ID'
=>
'ref.MAILING_ID'
28
], [
'join_type'
=>
'LEFT'
]
29
)
30
];
31
}
32
37
protected
function
checkLock
()
38
{
39
for
($i = 0; $i <= static::THREADS_COUNT; $i++)
40
{
41
if
($this->
lock
())
42
{
43
return
true
;
44
}
45
sleep(1);
46
}
47
return
false
;
48
}
49
}
Bitrix\Sender\Posting\ThreadStrategy\AbstractThreadStrategy
Definition
abstractthreadstrategy.php:16
Bitrix\Sender\Posting\ThreadStrategy\AbstractThreadStrategy\lock
lock()
Definition
abstractthreadstrategy.php:188
Bitrix\Sender\Posting\ThreadStrategy\AbstractThreadStrategy\$postingId
$postingId
Definition
abstractthreadstrategy.php:22
Bitrix\Sender\Posting\ThreadStrategy\SingleThreadStrategy
Definition
singlethreadstrategy.php:9
Bitrix\Sender\Posting\ThreadStrategy\SingleThreadStrategy\THREADS_COUNT
const THREADS_COUNT
Definition
singlethreadstrategy.php:10
Bitrix\Sender\Posting\ThreadStrategy\SingleThreadStrategy\checkLock
checkLock()
Definition
singlethreadstrategy.php:37
Bitrix\Sender\Posting\ThreadStrategy\SingleThreadStrategy\setFilter
setFilter()
Definition
singlethreadstrategy.php:12
Bitrix\Sender\Posting\ThreadStrategy\SingleThreadStrategy\setRuntime
setRuntime()
Definition
singlethreadstrategy.php:21
Bitrix\Sender\PostingRecipientTable
Definition
posting.php:663
Bitrix\Sender\PostingRecipientTable\SEND_RESULT_WAIT_ACCEPT
const SEND_RESULT_WAIT_ACCEPT
Definition
posting.php:669
Bitrix\Sender\PostingRecipientTable\SEND_RESULT_NONE
const SEND_RESULT_NONE
Definition
posting.php:664
Bitrix\Sender\Posting\ThreadStrategy
Definition
abstractthreadstrategy.php:3
modules
sender
lib
posting
threadstrategy
singlethreadstrategy.php
Создано системой
1.10.0