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
storeIOutboxStore<object>The outbox store to enqueue into.
payloadobjectThe untyped payload to enqueue.
headersIReadOnlyDictionary<string, string>Optional string-to-string headers. Pass null to use empty headers.
ctCancellationTokenCancellation 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).