1 | <?php |
||
6 | final class DeliveryMode |
||
7 | { |
||
8 | private const NON_PERSISTENT = 1; |
||
9 | private const PERSISTENT = 2; |
||
10 | |||
11 | private static $nonPersistent; |
||
12 | private static $persistent; |
||
13 | |||
14 | private $mode; |
||
15 | |||
16 | 2 | private function __construct(int $mode) |
|
20 | |||
21 | /** |
||
22 | * Message will be lost in case of server crash |
||
23 | */ |
||
24 | 1 | public static function nonPersistent(): self |
|
28 | |||
29 | /** |
||
30 | * Will persist the message to disk on the server, meaning it will be restored |
||
31 | * in case of a server crash (applies only to durable queues) |
||
32 | */ |
||
33 | 3 | public static function persistent(): self |
|
37 | |||
38 | 3 | public function toInt(): int |
|
42 | } |
||
43 |