1 | <?php |
||
8 | class ConsumeEvent extends Event |
||
9 | { |
||
10 | /** |
||
11 | * @var EnvelopeInterface |
||
12 | */ |
||
13 | private $envelope; |
||
14 | |||
15 | /** |
||
16 | * @var mixed |
||
17 | */ |
||
18 | private $result; |
||
19 | |||
20 | /** |
||
21 | * @var bool |
||
22 | */ |
||
23 | private $continueConsuming; |
||
24 | |||
25 | /** |
||
26 | * @param EnvelopeInterface $envelope The envelope that was consumed |
||
27 | * @param mixed $result The result of the consumed message |
||
28 | * @param bool $continue Whether to continue consuming or stop the thread blocking |
||
29 | */ |
||
30 | 3 | public function __construct(EnvelopeInterface $envelope, $result = null, $continue = true) |
|
36 | |||
37 | /** |
||
38 | * @return EnvelopeInterface |
||
39 | */ |
||
40 | 1 | public function getEnvelope() |
|
44 | |||
45 | /** |
||
46 | * @param mixed $result |
||
47 | */ |
||
48 | 1 | public function setResult($result) |
|
52 | |||
53 | /** |
||
54 | * @return mixed |
||
55 | */ |
||
56 | 1 | public function getResult() |
|
60 | |||
61 | /** |
||
62 | * @return bool |
||
63 | */ |
||
64 | 1 | public function shouldContinueConsuming() |
|
68 | |||
69 | /** |
||
70 | * Marks the event as to not continue consuming after this. |
||
71 | */ |
||
72 | public function stopConsuming() |
||
76 | } |
||
77 |