Final Class Yiisoft\Queue\Redis\Message\Message
| Inheritance | Yiisoft\Queue\Redis\Message\Message |
|---|---|
| Implements | Yiisoft\Queue\Message\MessageInterface |
Public Methods
Method Details
| public mixed __construct ( string $handlerName, mixed $data, array | ||
| $handlerName | string | |
| $data | mixed | |
| $metadata | array |
|
| $delay | integer | |
public function __construct(
private string $handlerName,
private mixed $data,
private array $metadata,
private int $delay = 0 //delay in seconds
) {
if ($this->delay > 0) {
$this->metadata['delay'] = $delay;
}
}
| public static self fromData ( string $type, mixed $data ) | ||
| $type | string | |
| $data | mixed | |
public static function fromData(string $type, mixed $data): self
{
return new self($type, $data, []);
}
| public string getHandlerName ( ) |
public function getHandlerName(): string
{
return $this->handlerName;
}
| public self withDelay ( integer $delay ) | ||
| $delay | integer | |
public function withDelay(int $delay): self
{
$message = clone $this;
$message->metadata['delay'] = $delay;
return $message;
}
| public static withMetadata ( array | ||
| $metadata | array |
|
public function withMetadata(array $metadata): static
{
$message = clone $this;
$message->metadata = $metadata;
return $message;
}
Signup or Login in order to comment.