Lines
n/a
0 / 0
Functions and Methods
n/a
0 / 0
Classes and Traits
n/a
0 / 0
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Tomaj\Hermes; | |
| 6 | ||
| 7 | interface MessageInterface | |
| 8 | { | |
| 9 | /** | |
| 10 | * Message identifier. | |
| 11 | * | |
| 12 | * This identifier should be unique all the time. | |
| 13 | * Recommendation is to use UUIDv4 (Included Message implementation | |
| 14 | * generating UUIDv4 identifiers) | |
| 15 | */ | |
| 16 | public function getId(): string; | |
| 17 | ||
| 18 | /** | |
| 19 | * Message creation date - microtime(true) | |
| 20 | */ | |
| 21 | public function getCreated(): float; | |
| 22 | ||
| 23 | /** | |
| 24 | * Message executing date - microtime(true) | |
| 25 | * | |
| 26 | * @return float | |
| 27 | */ | |
| 28 | public function getExecuteAt(): ?float; | |
| 29 | ||
| 30 | /** | |
| 31 | * Message type | |
| 32 | * | |
| 33 | * Based on this field, message will be dispatched and will be sent to | |
| 34 | * appropriate handler. | |
| 35 | */ | |
| 36 | public function getType(): string; | |
| 37 | ||
| 38 | /** | |
| 39 | * Payload data. | |
| 40 | * | |
| 41 | * This data can be used for anything that you would like to send to handler. | |
| 42 | * Warning! This data has to be serializable to string. Don't put there php resources | |
| 43 | * like database connection resources, file handlers etc.. | |
| 44 | * | |
| 45 | * @return array<mixed> | |
| 46 | */ | |
| 47 | public function getPayload(): ?array; | |
| 48 | ||
| 49 | /** | |
| 50 | * Total retries for message | |
| 51 | */ | |
| 52 | public function getRetries(): int; | |
| 53 | } |