|
2 | 2 |
|
3 | 3 | namespace Enqueue\Consumption; |
4 | 4 |
|
5 | | -use Enqueue\Consumption\Context\MessageReceived; |
6 | | -use Enqueue\Consumption\Context\MessageResult; |
7 | | -use Enqueue\Consumption\Context\PreConsume; |
8 | | -use Enqueue\Consumption\Context\PreSubscribe; |
9 | | -use Enqueue\Consumption\Context\Start; |
10 | | - |
11 | | -interface ExtensionInterface |
| 5 | +interface ExtensionInterface extends StartExtensionInterface, PreSubscribeExtensionInterface, PreConsumeExtensionInterface, MessageReceivedExtensionInterface, MessageResultExtensionInterface, ProcessorExceptionExtensionInterface |
12 | 6 | { |
13 | | - /** |
14 | | - * Executed only once at the very beginning of the QueueConsumer::consume method call. |
15 | | - */ |
16 | | - public function onStart(Start $context): void; |
17 | | - |
18 | | - /** |
19 | | - * The method is called for each BoundProcessor before calling SubscriptionConsumer::subscribe method. |
20 | | - */ |
21 | | - public function onPreSubscribe(PreSubscribe $context): void; |
22 | | - |
23 | | - /** |
24 | | - * Executed at every new cycle before calling SubscriptionConsumer::consume method. |
25 | | - * The consumption could be interrupted at this step. |
26 | | - */ |
27 | | - public function onPreConsume(PreConsume $context): void; |
28 | | - |
29 | | - /** |
30 | | - * Executed as soon as a a message is received, before it is passed to a processor |
31 | | - * The extension may set a result. If the result is set the processor is not called |
32 | | - * The processor could be changed or decorated at this point. |
33 | | - */ |
34 | | - public function onMessageReceived(MessageReceived $context): void; |
35 | | - |
36 | | - /** |
37 | | - * Executed when a message is processed by a processor or a result was set in onMessageReceived extension method. |
38 | | - * BEFORE the message status was sent to the broker |
39 | | - * The result could be changed at this point. |
40 | | - */ |
41 | | - public function onResult(MessageResult $context): void; |
42 | | - |
43 | 7 | /** |
44 | 8 | * Executed when a message is processed by a processor. |
45 | 9 | * The context contains a status, which could not be changed. |
|
0 commit comments