Interface Yiisoft\Queue\Message\MessageInterface
Represents a queue message with a type identifier, payload data, and metadata.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| fromData() | Creates a new message instance from the given type and payload data. | Yiisoft\Queue\Message\MessageInterface |
| getData() | Returns payload data. | Yiisoft\Queue\Message\MessageInterface |
| getMetadata() | Returns message metadata: timings, attempt count, metrics, etc. Keys are always strings. | Yiisoft\Queue\Message\MessageInterface |
| getType() | Returns message type. | Yiisoft\Queue\Message\MessageInterface |
| withMetadata() | Returns a new instance with the given message metadata. | Yiisoft\Queue\Message\MessageInterface |
Method Details
Creates a new message instance from the given type and payload data.
| public abstract static self fromData ( string $type, boolean|integer|float|string|array|null $data ) | ||
| $type | string |
Message type. |
| $data | boolean|integer|float|string|array|null |
Message payload data. Must contain only |
public static function fromData(string $type, bool|int|float|string|array|null $data): self;
Returns payload data.
| public abstract boolean|integer|float|string|array|null getData ( ) | ||
| return | boolean|integer|float|string|array|null |
Payload data containing only |
|---|---|---|
public function getData(): bool|int|float|string|array|null;
Returns message metadata: timings, attempt count, metrics, etc. Keys are always strings.
| public abstract array | ||
| return | array |
Metadata containing only |
|---|---|---|
public function getMetadata(): array;
Returns message type.
| public abstract string getType ( ) | ||
| return | string |
Message type. |
|---|---|---|
public function getType(): string;
Returns a new instance with the given message metadata.
| public abstract static withMetadata ( array | ||
| $metadata | array |
Metadata containing only |
public function withMetadata(array $metadata): static;
Signup or Login in order to comment.