Definition
Assembly: CloudNimble.SimpleMessageBus.Dispatch.dll Namespace: CloudNimble.SimpleMessageBus.Dispatch Inheritance: System.ObjectSyntax
Summary
An IMessageDispatcher implementation that processes the messages in parallel, regardless of the order the IMessageHandlerIMessageHandlers</see> were registered with the Dependency Injection container.Remarks
This dispatcher invokes all matching message handlers concurrently using parallel execution. This provides better performance when handlers are independent and don’t rely on execution order. However, it should be used carefully when handlers have side effects or shared dependencies that aren’t thread-safe.Constructors
.ctor
Initializes a new instance of the ParallelMessageDispatcher class.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
messageHandlers | System.Collections.Generic.IEnumerable<CloudNimble.SimpleMessageBus.Core.IMessageHandler> | The collection of message handlers to dispatch to. |
.ctor Inherited
Inherited from
objectSyntax
Methods
Dispatch
Sends the MessageEnvelope to the IMessageHandlerMessageHandlers</see> registered to that type, for processing.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
messageEnvelope | CloudNimble.SimpleMessageBus.Core.MessageEnvelope | The MessageEnvelope instance to be processed. |
Returns
Type:System.Threading.Tasks.Task
Remarks
Handlers are invoked concurrently using parallel execution. The method returns when all handlers have completed. If any handler throws an exception, other handlers will continue executing.Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
Related APIs
- CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher