Show / Hide Table of Contents

Class InProcessMessageRouter

An in process message router invoking the message processor.

Inheritance
System.Object
Loggable
MessageRouterBase
InProcessMessageRouter
Implements
ILoggable
IMessageRouter
System.IDisposable
Inherited Members
MessageRouterBase.ReplyReceived
MessageRouterBase.MessageProcessor
MessageRouterBase.Dispose()
MessageRouterBase.Dispose(Boolean)
MessageRouterBase.CreateBrokeredMessageBuilder(IContext)
MessageRouterBase.RouteInputAsync(IBrokeredMessage, IContext, CancellationToken)
MessageRouterBase.OnReplyReceived(ReplyReceivedEventArgs)
Loggable.Logger
Loggable.GetLogger()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Messaging.Distributed.Routing
Assembly: Kephas.Messaging.dll
Syntax
[ProcessingPriority(Priority.Lowest)]
public class InProcessMessageRouter : MessageRouterBase, ILoggable, IMessageRouter, IDisposable
Remarks

For the in-process message router, the DispatchAsync(IBrokeredMessage, IContext, CancellationToken) method represents the input queue.

Constructors

| Improve this Doc View Source

InProcessMessageRouter(IMessageProcessor, IExportFactory<IBrokeredMessageBuilder>, Lazy<IMessageBroker>)

Initializes a new instance of the InProcessMessageRouter class.

Declaration
public InProcessMessageRouter(IMessageProcessor messageProcessor, IExportFactory<IBrokeredMessageBuilder> messageBuilderFactory, Lazy<IMessageBroker> lazyMessageBroker)
Parameters
Type Name Description
IMessageProcessor messageProcessor

The message processor.

IExportFactory<IBrokeredMessageBuilder> messageBuilderFactory

The message builder factory.

System.Lazy<IMessageBroker> lazyMessageBroker

The lazy message broker.

Methods

| Improve this Doc View Source

DispatchAsync(IBrokeredMessage, IContext, CancellationToken)

Sends the brokered message asynchronously over the physical medium.

Declaration
public override Task<(RoutingInstruction action, IMessage reply)> DispatchAsync(IBrokeredMessage brokeredMessage, IContext context, CancellationToken cancellationToken)
Parameters
Type Name Description
IBrokeredMessage brokeredMessage

The brokered message.

IContext context

The routing context.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<System.ValueTuple<RoutingInstruction, IMessage>>

The asynchronous result yielding an action to take further and an optional reply.

Overrides
MessageRouterBase.DispatchAsync(IBrokeredMessage, IContext, CancellationToken)
| Improve this Doc View Source

ProcessAsync(IBrokeredMessage, IContext, CancellationToken)

Processes the brokered message locally, asynchronously.

Declaration
protected override Task<IMessage> ProcessAsync(IBrokeredMessage brokeredMessage, IContext context, CancellationToken cancellationToken)
Parameters
Type Name Description
IBrokeredMessage brokeredMessage

The brokered message.

IContext context

The routing context.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IMessage>

An asynchronous result that yields the reply message.

Overrides
MessageRouterBase.ProcessAsync(IBrokeredMessage, IContext, CancellationToken)
| Improve this Doc View Source

RouteOutputAsync(IBrokeredMessage, IContext, CancellationToken)

Routes the brokered message asynchronously, typically over the physical medium.

Declaration
protected override Task<(RoutingInstruction action, IMessage reply)> RouteOutputAsync(IBrokeredMessage brokeredMessage, IContext context, CancellationToken cancellationToken)
Parameters
Type Name Description
IBrokeredMessage brokeredMessage

The brokered message.

IContext context

The send context.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<System.ValueTuple<RoutingInstruction, IMessage>>

The asynchronous result yielding an action to take further and an optional reply.

Overrides
MessageRouterBase.RouteOutputAsync(IBrokeredMessage, IContext, CancellationToken)

Implements

ILoggable
IMessageRouter
System.IDisposable

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX