Show / Hide Table of Contents

Class MessageBrokerExtensions

Extension methods for IMessageBroker.

Inheritance
System.Object
MessageBrokerExtensions
Inherited Members
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
Assembly: Kephas.Messaging.dll
Syntax
public static class MessageBrokerExtensions

Methods

| Improve this Doc View Source

CreateBrokeredMessageBuilder(IContext)

Creates an initialized brokered message builder.

Declaration
public static IBrokeredMessageBuilder CreateBrokeredMessageBuilder(this IContext context)
Parameters
Type Name Description
IContext context

The publishing context.

Returns
Type Description
IBrokeredMessageBuilder

The new brokered message builder.

| Improve this Doc View Source

ProcessAsync(IMessageBroker, Object, IEndpoint, IContext, CancellationToken)

Processes a message asynchronously, waiting for a response from the handler.

Declaration
public static Task<IMessage> ProcessAsync(this IMessageBroker messageBroker, object message, IEndpoint recipient, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object message

The message to be processed.

IEndpoint recipient

The recipient.

IContext context

The processing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

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

The asynchronous result yielding the response message.

| Improve this Doc View Source

ProcessAsync(IMessageBroker, Object, IContext, CancellationToken)

Processes a message asynchronously, waiting for a response from the handler.

Declaration
public static Task<IMessage> ProcessAsync(this IMessageBroker messageBroker, object message, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object message

The message to be processed.

IContext context

The processing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

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

The asynchronous result yielding the response message.

| Improve this Doc View Source

ProcessAsync(IMessageBroker, Object, IEnumerable<IEndpoint>, IContext, CancellationToken)

Processes a message asynchronously, waiting for a response from the handler.

Declaration
public static Task<IMessage> ProcessAsync(this IMessageBroker messageBroker, object message, IEnumerable<IEndpoint> recipients, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object message

The message to be processed.

System.Collections.Generic.IEnumerable<IEndpoint> recipients

The recipients.

IContext context

The processing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

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

The asynchronous result yielding the response message.

| Improve this Doc View Source

ProcessOneWayAsync(IMessageBroker, Object, IEndpoint, IContext, CancellationToken)

Processes a message asynchronously without waiting for a response from the handler.

Declaration
public static Task<IMessage> ProcessOneWayAsync(this IMessageBroker messageBroker, object message, IEndpoint recipient, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object message

The message to be processed.

IEndpoint recipient

The recipient.

IContext context

The processing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

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

The asynchronous result.

| Improve this Doc View Source

ProcessOneWayAsync(IMessageBroker, Object, IContext, CancellationToken)

Processes a message asynchronously without waiting for a response from the handler.

Declaration
public static Task<IMessage> ProcessOneWayAsync(this IMessageBroker messageBroker, object message, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object message

The message to be processed.

IContext context

The processing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

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

The asynchronous result.

| Improve this Doc View Source

ProcessOneWayAsync(IMessageBroker, Object, IEnumerable<IEndpoint>, IContext, CancellationToken)

Processes a message asynchronously without waiting for a response from the handler.

Declaration
public static Task<IMessage> ProcessOneWayAsync(this IMessageBroker messageBroker, object message, IEnumerable<IEndpoint> recipients, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object message

The message to be processed.

System.Collections.Generic.IEnumerable<IEndpoint> recipients

The recipients.

IContext context

The processing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

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

The asynchronous result.

| Improve this Doc View Source

Publish(IMessageBroker, Object, IExpando, IContext)

Publishes the event with the provided ID and arguments.

Declaration
public static void Publish(this IMessageBroker messageBroker, object eventId, IExpando eventArgs, IContext context)
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker.

System.Object eventId

Identifier for the application event.

IExpando eventArgs

The application event arguments.

IContext context

Optional. the context.

| Improve this Doc View Source

Publish(IMessageBroker, Object, IContext)

Publishes the provided event.

Declaration
public static void Publish(this IMessageBroker messageBroker, object event, IContext context)
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker.

System.Object event

The event.

IContext context

The context.

| Improve this Doc View Source

Publish<TEvent>(IMessageBroker, IContext)

Publishes the provided event.

Declaration
public static void Publish<TEvent>(this IMessageBroker messageBroker, IContext context)

    where TEvent : class, new()
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker.

IContext context

The context.

Type Parameters
Name Description
TEvent

Type of the event.

| Improve this Doc View Source

PublishAsync(IMessageBroker, Object, IExpando, IContext, CancellationToken)

Asynchronously publishes the event with the provided ID and arguments.

Declaration
public static Task PublishAsync(this IMessageBroker messageBroker, object eventId, IExpando eventArgs, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker.

System.Object eventId

Identifier for the event.

IExpando eventArgs

The application event arguments.

IContext context

The context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

| Improve this Doc View Source

PublishAsync(IMessageBroker, Object, IEndpoint, IContext, CancellationToken)

Publishes an event asynchronously.

Declaration
public static Task PublishAsync(this IMessageBroker messageBroker, object event, IEndpoint recipient, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object event

The event message.

IEndpoint recipient

The recipient.

IContext context

The publishing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

The asynchronous result.

Remarks

It does not wait for an answer from the subscribers, just for the acknowledgement of the message being sent.

| Improve this Doc View Source

PublishAsync(IMessageBroker, Object, IContext, CancellationToken)

Publishes an event asynchronously.

Declaration
public static Task PublishAsync(this IMessageBroker messageBroker, object event, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object event

The event message.

IContext context

The publishing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

The asynchronous result.

Remarks

It does not wait for an answer from the subscribers, just for the acknowledgement of the message being sent.

| Improve this Doc View Source

PublishAsync(IMessageBroker, Object, IEnumerable<IEndpoint>, IContext, CancellationToken)

Publishes an event asynchronously.

Declaration
public static Task PublishAsync(this IMessageBroker messageBroker, object event, IEnumerable<IEndpoint> recipients, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker to act on.

System.Object event

The event message.

System.Collections.Generic.IEnumerable<IEndpoint> recipients

The recipients.

IContext context

The publishing context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

The asynchronous result.

Remarks

It does not wait for an answer from the subscribers, just for the acknowledgement of the message being sent.

| Improve this Doc View Source

PublishAsync<TEvent>(IMessageBroker, IContext, CancellationToken)

Publishes the provided event.

Declaration
public static Task PublishAsync<TEvent>(this IMessageBroker messageBroker, IContext context, CancellationToken cancellationToken = default(CancellationToken))

    where TEvent : class, new()
Parameters
Type Name Description
IMessageBroker messageBroker

The message broker.

IContext context

The context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

Type Parameters
Name Description
TEvent

Type of the event.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX