1 | <?php |
||
6 | final class Publish |
||
7 | { |
||
8 | private $message; |
||
9 | private $exchange = ''; |
||
10 | private $routingKey = ''; |
||
11 | private $mandatory = false; |
||
12 | private $immediate = false; |
||
13 | |||
14 | 6 | public function __construct(Message $message) |
|
18 | |||
19 | 2 | public function to(string $exchange): self |
|
26 | |||
27 | 1 | public function toDefaultExchange(): self |
|
34 | |||
35 | 2 | public function withRoutingKey(string $key): self |
|
42 | |||
43 | /** |
||
44 | * This will raise an error if the message can't be routed |
||
45 | */ |
||
46 | 2 | public function flagAsMandatory(): self |
|
53 | |||
54 | /** |
||
55 | * This will fail silently if the message can't be routed |
||
56 | */ |
||
57 | 1 | public function flagAsNotMandatory(): self |
|
64 | |||
65 | /** |
||
66 | * This will raise an error if the message can't be delivered immediately |
||
67 | */ |
||
68 | 2 | public function flagAsImmediate(): self |
|
75 | |||
76 | /** |
||
77 | * This will fail silently if the message can't be delivered immediately |
||
78 | */ |
||
79 | 1 | public function flagAsNotImmediate(): self |
|
86 | |||
87 | 1 | public function message(): Message |
|
91 | |||
92 | 3 | public function exchange(): string |
|
96 | |||
97 | 3 | public function routingKey(): string |
|
101 | |||
102 | 3 | public function mandatory(): bool |
|
106 | |||
107 | 3 | public function immediate(): bool |
|
111 | } |
||
112 |