Skip to main content

Definition

Assembly: CloudNimble.SimpleMessageBus.Dispatch.dll Namespace: CloudNimble.SimpleMessageBus.Dispatch

Syntax

CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher

Summary

Defines the required composition of every Dispatcher used by SimpleMessageBus to send MessageEnvelopeMessageEnvelopes</see> to the IMessageHandlerIMessageHandlers</see> registered to handle that message’s Type.

Remarks

Message dispatchers control how messages are delivered to their handlers. SimpleMessageBus provides two built-in implementations: OrderedMessageDispatcher for sequential processing and ParallelMessageDispatcher for concurrent processing. Custom dispatchers can be implemented for specialized routing or processing logic.

Methods

Dispatch Abstract

Dispatches an incoming MessageEnvelope to the IMessageHandlerIMessageHandlers</see> registered to handle that message’s Type.

Syntax

System.Threading.Tasks.Task Dispatch(CloudNimble.SimpleMessageBus.Core.MessageEnvelope messageEnvelope)

Parameters

NameTypeDescription
messageEnvelopeCloudNimble.SimpleMessageBus.Core.MessageEnvelopeThe MessageEnvelope instance to send to the registered IMessageHandlerIMessageHandlers</see>.

Returns

Type: System.Threading.Tasks.Task A Task reference for the asynchronous function.

Remarks

The implementation determines how handlers are invoked - sequentially, in parallel, or using custom logic. All matching handlers (those that declare support for the message type) will be called.