Table of Contents

Class OutboxStoreExtensions

Namespace
PatternKit.Messaging.Reliability
Assembly
PatternKit.Core.dll

Convenience extension methods for IOutboxStore<TPayload>.

public static class OutboxStoreExtensions
Inheritance
OutboxStoreExtensions
Inherited Members

Methods

EnqueueObjectAsync(IOutboxStore<object>, object, IReadOnlyDictionary<string, string>?, CancellationToken)

Convenience overload that accepts an untyped payload and an optional header dictionary, boxes them into a Message<object>, and enqueues via the typed store.

public static ValueTask<OutboxMessage<object>> EnqueueObjectAsync(this IOutboxStore<object> store, object payload, IReadOnlyDictionary<string, string>? headers, CancellationToken ct = default)

Parameters

store IOutboxStore<object>

The outbox store to enqueue into.

payload object

The untyped payload to enqueue.

headers IReadOnlyDictionary<string, string>

Optional string-to-string headers. Pass null to use empty headers.

ct CancellationToken

Cancellation token.

Returns

ValueTask<OutboxMessage<object>>

The stored OutboxMessage<object>.

Remarks

Use when the calling layer does not have compile-time knowledge of the payload type (e.g., a generic workflow-step orchestrator). Projects that want this convenience should consume IOutboxStore<object> as their dependency. When headers is null, the message is enqueued with Empty (no allocation).