Final Class Yiisoft\Queue\Message\GenericMessage
| Inheritance | Yiisoft\Queue\Message\GenericMessage » Yiisoft\Queue\Message\Message |
|---|---|
| Implements | Yiisoft\Queue\Message\MessageInterface |
A general-purpose immutable {@see MessageInterface} implementation that holds a message type and its payload data.
Prefer creating custom message classes that better express your domain.
Public Methods
Method Details
| public mixed __construct ( string $type, boolean|integer|float|string|array|null $payload ) | ||
| $type | string |
A message type used to resolve the handler. |
| $payload | boolean|integer|float|string|array|null |
Message payload data. Must contain only |
public function __construct(
private readonly string $type,
private readonly bool|int|float|string|array|null $payload,
) {}
| public static static fromPayload ( string $type, boolean|integer|float|string|array|null $payload ) | ||
| $type | string | |
| $payload | boolean|integer|float|string|array|null | |
public static function fromPayload(string $type, bool|int|float|string|array|null $payload): static
{
return new self($type, $payload);
}
Defined in: Yiisoft\Queue\Message\Message::getMeta()
| public array getMeta ( ) |
final public function getMeta(): array
{
return $this->meta;
}
| public bool|int|float|string|array|null getPayload ( ) |
public function getPayload(): bool|int|float|string|array|null
{
return $this->payload;
}
Defined in: Yiisoft\Queue\Message\Message::withMeta()
| public static withMeta ( array $meta ) | ||
| $meta | array | |
final public function withMeta(array $meta): static
{
$new = clone $this;
$new->meta = $meta;
return $new;
}
Signup or Login in order to comment.