Skip to content

InboxExtensions Methods

Registers typed subject handlers with an IInbox.

Register(IInbox, MessageType<T>, TArg, Action<T, TArg, IInboxHandlerContext>)

staticextension
View source
public static IInbox Register<T, TArg>(this IInbox inbox, MessageType<T> messageType, TArg argument, Action<T, TArg, IInboxHandlerContext> handler)
Registers a synchronous subject handler with an explicit argument.

Parameters

inboxIInbox
The inbox.
messageTypeMessageType<T>
The subject and serializer binding.
argumentTArg
The argument stored with the handler.
handlerAction<T, TArg, IInboxHandlerContext>
The synchronous body, argument, and context delegate.

Returns

The inbox.

Register(IInbox, MessageType<T>, TArg, Func<T, TArg, IInboxHandlerContext, CancellationToken, ValueTask>)

staticextension
View source
public static IInbox Register<T, TArg>(this IInbox inbox, MessageType<T> messageType, TArg argument, Func<T, TArg, IInboxHandlerContext, CancellationToken, ValueTask> handler)
Registers an asynchronous subject handler with an explicit argument.

Parameters

inboxIInbox
The inbox.
messageTypeMessageType<T>
The subject and serializer binding.
argumentTArg
The argument stored with the handler.
handlerFunc<T, TArg, IInboxHandlerContext, CancellationToken, ValueTask>
The body, argument, context, and attempt-token delegate.

Returns

The inbox.

Register(IInbox, MessageType<T>, Action<T, IInboxHandlerContext>)

staticextension
View source
public static IInbox Register<T>(this IInbox inbox, MessageType<T> messageType, Action<T, IInboxHandlerContext> handler)
Registers a synchronous subject handler.

Parameters

inboxIInbox
The inbox.
messageTypeMessageType<T>
The subject and serializer binding.
handlerAction<T, IInboxHandlerContext>
The synchronous body and context delegate.

Returns

The inbox.

Register(IInbox, MessageType<T>, Func<T, IInboxHandlerContext, CancellationToken, ValueTask>)

staticextension
View source
public static IInbox Register<T>(this IInbox inbox, MessageType<T> messageType, Func<T, IInboxHandlerContext, CancellationToken, ValueTask> handler)
Registers a subject handler supporting asynchronous preparation.

Parameters

inboxIInbox
The inbox.
messageTypeMessageType<T>
The subject and serializer binding.
handlerFunc<T, IInboxHandlerContext, CancellationToken, ValueTask>
The body, context, and attempt-token delegate.

Returns

The inbox.