1 | <?php |
||
19 | class QueueService |
||
20 | { |
||
21 | /** @var QueueRepository */ |
||
22 | protected $repository; |
||
23 | |||
24 | /** @var EntityFactoryInterface */ |
||
25 | protected $entityFactory; |
||
26 | |||
27 | /** @var EventDispatcherInterface */ |
||
28 | protected $eventDispatcher; |
||
29 | |||
30 | /** @var int */ |
||
31 | protected $maxAttempts; |
||
32 | |||
33 | /** @var array */ |
||
34 | protected $queueSuitableStatuses = [ |
||
35 | QueueEntityMappedSuperclass::STATUS_NEW, |
||
36 | QueueEntityMappedSuperclass::STATUS_IN_PROGRESS |
||
37 | ]; |
||
38 | |||
39 | 10 | public function __construct( |
|
50 | |||
51 | /** |
||
52 | * @param int $limit |
||
53 | * @param int | null $offset |
||
54 | * |
||
55 | * @throws \Doctrine\ORM\TransactionRequiredException |
||
56 | * |
||
57 | * @return array|QueueEntityInterface[] |
||
58 | */ |
||
59 | 1 | public function getToRestore(int $limit, ?int $offset = null): array |
|
63 | |||
64 | /** |
||
65 | * @param int $id |
||
66 | * |
||
67 | * @throws Exception |
||
68 | * |
||
69 | * @return QueueEntityInterface |
||
70 | */ |
||
71 | 5 | public function getToProcess(int $id): QueueEntityInterface |
|
105 | |||
106 | /** |
||
107 | * @param int $limit |
||
108 | * @param int|null $offset |
||
109 | * |
||
110 | * @throws \Doctrine\ORM\TransactionRequiredException |
||
111 | * |
||
112 | * @return array|QueueEntityInterface[] |
||
113 | */ |
||
114 | public function getToRepublish(int $limit, ?int $offset = null): array |
||
118 | |||
119 | /** |
||
120 | * @param QueueInterface $queueable |
||
121 | * |
||
122 | * @throws UnexpectedValueException |
||
123 | * |
||
124 | * @return QueueEntityInterface |
||
125 | */ |
||
126 | 2 | public function createQueue(QueueInterface $queueable): QueueEntityInterface |
|
132 | |||
133 | public function flush(QueueEntityInterface $entity = null): void |
||
137 | |||
138 | 3 | public function save(QueueEntityInterface $entity): QueueEntityInterface |
|
144 | |||
145 | 2 | public function isTransactionActive(): bool |
|
149 | |||
150 | public function beginTransaction(): void |
||
154 | |||
155 | public function rollback(): void |
||
159 | |||
160 | public function commit(): void |
||
164 | } |
||
165 |