0 follower

Abstract Class Yiisoft\Queue\Message\Message

InheritanceYiisoft\Queue\Message\Message
ImplementsYiisoft\Queue\Message\MessageInterface
SubclassesYiisoft\Queue\Message\GenericMessage

Public Methods

Hide inherited 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() Yiisoft\Queue\Message\Message
getType() Returns message type. Yiisoft\Queue\Message\MessageInterface
withMetadata() Yiisoft\Queue\Message\Message

Method Details

Hide inherited methods

fromData() public abstract static method

Defined in: Yiisoft\Queue\Message\MessageInterface::fromData()

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 null, scalars (bool, int, float, string), or arrays composed of the same types recursively.

                public static function fromData(string $type, bool|int|float|string|array|null $data): self;

            
getData() public abstract method

Defined in: Yiisoft\Queue\Message\MessageInterface::getData()

Returns payload data.

public abstract boolean|integer|float|string|array|null getData ( )
return boolean|integer|float|string|array|null

Payload data containing only null, scalars (bool, int, float, string), or arrays composed of the same types recursively.

                public function getData(): bool|int|float|string|array|null;

            
getMetadata() public method

public array getMetadata ( )

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

            
getType() public abstract method

Defined in: Yiisoft\Queue\Message\MessageInterface::getType()

Returns message type.

public abstract string getType ( )
return string

Message type.

                public function getType(): string;

            
withMetadata() public method

public static withMetadata ( array $metadata )
$metadata array

                final public function withMetadata(array $metadata): static
{
    $new = clone $this;
    $new->metadata = $metadata;
    return $new;
}