1 | <?php declare(strict_types=1); |
||
8 | abstract class AbstractProducer |
||
9 | { |
||
10 | /** |
||
11 | * @var int |
||
12 | */ |
||
13 | public const DELIVERY_MODE_NON_PERSISTENT = 1; |
||
14 | |||
15 | /** |
||
16 | * @var int |
||
17 | */ |
||
18 | public const DELIVERY_MODE_PERSISTENT = 2; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | public const CONTENT_TYPE_APPLICATION_JSON = 'application/json'; |
||
24 | |||
25 | /** |
||
26 | * @return bool|int|PromiseInterface |
||
27 | */ |
||
28 | final public function produce(Channel $channel, $body) |
||
39 | |||
40 | abstract protected function getExchangeName(): string; |
||
41 | |||
42 | abstract protected function getRoutingKey(): string; |
||
43 | |||
44 | protected function getHeaders(): array |
||
48 | |||
49 | protected function isMandatory(): bool |
||
53 | |||
54 | protected function isImmediate(): bool |
||
58 | } |
||
59 |