Final Class Yiisoft\Queue\Message\Message
| Inheritance | Yiisoft\Queue\Message\Message |
|---|---|
| Implements | Yiisoft\Queue\Message\MessageInterface |
Public Methods
Method Details
| public mixed __construct ( string $handlerName, mixed $data, array $metadata = [] ) | ||
| $handlerName | string |
A name of a handler which should handle this message. |
| $data | mixed |
Message data, encodable by a queue adapter |
| $metadata | array |
Message metadata, encodable by a queue adapter |
public function __construct(
private readonly string $handlerName,
private readonly mixed $data,
private array $metadata = [],
) {
}
| public static Yiisoft\Queue\Message\MessageInterface fromData ( string $handlerName, mixed $data, array $metadata = [] ) | ||
| $handlerName | string | |
| $data | mixed | |
| $metadata | array | |
public static function fromData(string $handlerName, mixed $data, array $metadata = []): MessageInterface
{
return new self($handlerName, $data, $metadata);
}
| public string getHandlerName ( ) |
public function getHandlerName(): string
{
return $this->handlerName;
}
Signup or Login in order to comment.