0

Abstract Class Yiisoft\Queue\Message\Message

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

Base implementation of {@see MessageInterface} providing metadata storage.

Public Methods

Hide inherited methods

Method Description Defined By
fromPayload() Creates a new message instance from the given type and payload data. Yiisoft\Queue\Message\MessageInterface
getMeta() Yiisoft\Queue\Message\Message
getPayload() Returns payload data. Yiisoft\Queue\Message\MessageInterface
getType() Returns message type. Yiisoft\Queue\Message\MessageInterface
withMeta() Yiisoft\Queue\Message\Message

Method Details

Hide inherited methods

fromPayload() public abstract static method

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

Creates a new message instance from the given type and payload data.

public abstract static static fromPayload ( string $type, boolean|integer|float|string|array|null $payload )
$type string

Message type.

$payload 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.

return static

Instance of the called class with the given type and payload.

                public static function fromPayload(string $type, bool|int|float|string|array|null $payload): static;

            
getMeta() public method

public array getMeta ( )

                final public function getMeta(): array
{
    return $this->meta;
}

            
getPayload() public abstract method

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

Returns payload data.

public abstract boolean|integer|float|string|array|null getPayload ( )
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 getPayload(): bool|int|float|string|array|null;

            
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;

            
withMeta() public method

public static withMeta ( array $meta )
$meta array

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