0 follower

Final Class Yiisoft\Queue\Redis\Message\Message

InheritanceYiisoft\Queue\Redis\Message\Message
ImplementsYiisoft\Queue\Message\MessageInterface

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string $handlerName, mixed $data, array $metadata, integer $delay 0 )
$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;
    }
}

            
fromData() public static method

public static self fromData ( string $handlerName, mixed $data, array $metadata = [] )
$handlerName string
$data mixed
$metadata array

                public static function fromData(string $handlerName, mixed $data, array $metadata = []): self
{
    return new self($handlerName, $data, $metadata);
}

            
getData() public method

public mixed getData ( )

                public function getData(): mixed
{
    return $this->data;
}

            
getHandlerName() public method

public string getHandlerName ( )

                public function getHandlerName(): string
{
    return $this->handlerName;
}

            
getMetadata() public method

public array getMetadata ( )

                public function getMetadata(): array
{
    return $this->metadata;
}

            
withDelay() public method

public self withDelay ( integer $delay )
$delay integer

                public function withDelay(int $delay): self
{
    $message = clone $this;
    $message->metadata['delay'] = $delay;
    return $message;
}