Final Class Yiisoft\Queue\Middleware\FailureHandling\FailureEnvelope
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $meta | array | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| fromMessage() | Yiisoft\ |
|
| fromPayload() | Envelopes cannot be created from a raw payload. Use {@see fromMessage()} to wrap an existing message instead. | Yiisoft\ |
| getFailureMeta() | Yiisoft\ |
|
| getFailureMetaValue() | Yiisoft\ |
|
| getMessage() | Yiisoft\ |
|
| getMeta() | Yiisoft\ |
|
| getPayload() | Yiisoft\ |
|
| getType() | Yiisoft\ |
|
| withMeta() | Yiisoft\ |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| META_FAILURE | 'yii-failure' | Yiisoft\ |
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $message | Yiisoft\ |
|
| $failureMeta | array | |
public function __construct(MessageInterface $message, array $failureMeta = [])
{
/** @psalm-var FailureMeta */
$this->failureMeta = $failureMeta === []
? self::getFailureMetaFromMessage($message)
: ArrayHelper::merge(
self::getFailureMetaFromMessage($message),
$failureMeta,
);
parent::__construct($message, [
self::META_FAILURE => $this->failureMeta,
]);
}
| public static static fromMessage ( Yiisoft\ | ||
| $message | Yiisoft\ |
|
public static function fromMessage(MessageInterface $message): static
{
return new self(
$message,
self::getFailureMetaFromMessage($message),
);
}
Defined in:
Yiisoft\
Envelopes cannot be created from a raw payload. Use {@see fromMessage()} to wrap an existing message instead.
| public static static fromPayload ( string $type, mixed $payload ) | ||
| $type | string | |
| $payload | mixed | |
| throws | LogicException |
Always, since this method is not supported for envelopes. |
|---|---|---|
final public static function fromPayload(string $type, mixed $payload): static
{
throw new LogicException(
'Envelopes cannot be created via "fromPayload()". Wrap an existing "MessageInterface" instance instead.',
);
}
| public array getFailureMeta ( ) |
public function getFailureMeta(): array
{
return $this->failureMeta;
}
| public mixed getFailureMetaValue ( string $key, mixed $default = null ) | ||
| $key | string | |
| $default | mixed | |
public function getFailureMetaValue(string $key, mixed $default = null): mixed
{
return $this->failureMeta[$key] ?? $default;
}
Defined in:
Yiisoft\
| public Yiisoft\ |
final public function getMessage(): MessageInterface
{
return $this->message;
}
Defined in:
Yiisoft\
| public array getMeta ( ) |
final public function getMeta(): array
{
return $this->meta;
}
Defined in:
Yiisoft\
| public bool|int|float|string|array|null getPayload ( ) |
final public function getPayload(): bool|int|float|string|array|null
{
return $this->message->getPayload();
}
Defined in:
Yiisoft\
| public string getType ( ) |
final public function getType(): string
{
return $this->message->getType();
}
Defined in:
Yiisoft\
| public static withMeta ( array $meta ) | ||
| $meta | array | |
final public function withMeta(array $meta): static
{
return static::fromMessage($this->message->withMeta($meta));
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.