Show / Hide Table of Contents

Class MessageHandler.Builder

Represents builder of message handlers.

Inheritance
object
MessageHandler.Builder
Implements
ISupplier<MessageHandler>
IFunctional<Func<MessageHandler>>
IResettable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DotNext.Net.Cluster.Messaging
Assembly: DotNext.Net.Cluster.dll
Syntax
public sealed class MessageHandler.Builder : ISupplier<MessageHandler>, IFunctional<Func<MessageHandler>>, IResettable

Constructors

| Edit this page View Source

Builder()

Initializes a new builder.

Declaration
public Builder()

Methods

| Edit this page View Source

Add<TInput>(string, Func<ISubscriber, TInput, object?, CancellationToken, Task>)

Registers signal handler.

Declaration
public MessageHandler.Builder Add<TInput>(string messageName, Func<ISubscriber, TInput, object?, CancellationToken, Task> signalHandler) where TInput : ISerializable<TInput>
Parameters
Type Name Description
string messageName

The name of the message.

Func<ISubscriber, TInput, object, CancellationToken, Task> signalHandler

The handler.

Returns
Type Description
MessageHandler.Builder

This builder.

Type Parameters
Name Description
TInput

The type of the message.

| Edit this page View Source

Add<TInput>(string, Func<ISubscriber, TInput, CancellationToken, Task>)

Registers signal handler.

Declaration
public MessageHandler.Builder Add<TInput>(string messageName, Func<ISubscriber, TInput, CancellationToken, Task> signalHandler) where TInput : ISerializable<TInput>
Parameters
Type Name Description
string messageName

The name of the message.

Func<ISubscriber, TInput, CancellationToken, Task> signalHandler

The handler.

Returns
Type Description
MessageHandler.Builder

This builder.

Type Parameters
Name Description
TInput

The type of the message.

| Edit this page View Source

Add<TInput>(string, Func<TInput, object?, CancellationToken, Task>)

Registers signal handler.

Declaration
public MessageHandler.Builder Add<TInput>(string messageName, Func<TInput, object?, CancellationToken, Task> signalHandler) where TInput : ISerializable<TInput>
Parameters
Type Name Description
string messageName

The name of the message.

Func<TInput, object, CancellationToken, Task> signalHandler

The handler.

Returns
Type Description
MessageHandler.Builder

This builder.

Type Parameters
Name Description
TInput

The type of the message.

| Edit this page View Source

Add<TInput>(string, Func<TInput, CancellationToken, Task>)

Registers signal handler.

Declaration
public MessageHandler.Builder Add<TInput>(string messageName, Func<TInput, CancellationToken, Task> signalHandler) where TInput : ISerializable<TInput>
Parameters
Type Name Description
string messageName

The name of the message.

Func<TInput, CancellationToken, Task> signalHandler

The handler.

Returns
Type Description
MessageHandler.Builder

This builder.

Type Parameters
Name Description
TInput

The type of the message.

| Edit this page View Source

Add<TInput, TOutput>(string, Func<ISubscriber, TInput, object?, CancellationToken, Task<TOutput>>, string, string?)

Registers duplex message handler.

Declaration
public MessageHandler.Builder Add<TInput, TOutput>(string inputMessageName, Func<ISubscriber, TInput, object?, CancellationToken, Task<TOutput>> messageHandler, string outputMessageName, string? outputMessageType = null) where TInput : ISerializable<TInput> where TOutput : ISerializable<TOutput>
Parameters
Type Name Description
string inputMessageName

The name of TInput message.

Func<ISubscriber, TInput, object, CancellationToken, Task<TOutput>> messageHandler

The message handler.

string outputMessageName

The name of TOutput message.

string outputMessageType

MIME type of TOutput message.

Returns
Type Description
MessageHandler.Builder

This builder.

Type Parameters
Name Description
TInput

The type of the input message.

TOutput

The type of the output message.

| Edit this page View Source

Add<TInput, TOutput>(string, Func<ISubscriber, TInput, CancellationToken, Task<TOutput>>, string, string?)

Registers duplex message handler.

Declaration
public MessageHandler.Builder Add<TInput, TOutput>(string inputMessageName, Func<ISubscriber, TInput, CancellationToken, Task<TOutput>> messageHandler, string outputMessageName, string? outputMessageType = null) where TInput : ISerializable<TInput> where TOutput : ISerializable<TOutput>
Parameters
Type Name Description
string inputMessageName

The name of TInput message.

Func<ISubscriber, TInput, CancellationToken, Task<TOutput>> messageHandler

The message handler.

string outputMessageName

The name of TOutput message.

string outputMessageType

MIME type of TOutput message.

Returns
Type Description
MessageHandler.Builder

This builder.

Type Parameters
Name Description
TInput

The type of the input message.

TOutput

The type of the output message.

| Edit this page View Source

Add<TInput, TOutput>(string, Func<TInput, object?, CancellationToken, Task<TOutput>>, string, string?)

Registers duplex message handler.

Declaration
public MessageHandler.Builder Add<TInput, TOutput>(string inputMessageName, Func<TInput, object?, CancellationToken, Task<TOutput>> messageHandler, string outputMessageName, string? outputMessageType = null) where TInput : ISerializable<TInput> where TOutput : ISerializable<TOutput>
Parameters
Type Name Description
string inputMessageName

The name of TInput message.

Func<TInput, object, CancellationToken, Task<TOutput>> messageHandler

The message handler.

string outputMessageName

The name of TOutput message.

string outputMessageType

MIME type of TOutput message.

Returns
Type Description
MessageHandler.Builder

This builder.

Type Parameters
Name Description
TInput

The type of the input message.

TOutput

The type of the output message.

| Edit this page View Source

Add<TInput, TOutput>(string, Func<TInput, CancellationToken, Task<TOutput>>, string, string?)

Registers duplex message handler.

Declaration
public MessageHandler.Builder Add<TInput, TOutput>(string inputMessageName, Func<TInput, CancellationToken, Task<TOutput>> messageHandler, string outputMessageName, string? outputMessageType = null) where TInput : ISerializable<TInput> where TOutput : ISerializable<TOutput>
Parameters
Type Name Description
string inputMessageName

The name of TInput message.

Func<TInput, CancellationToken, Task<TOutput>> messageHandler

The message handler.

string outputMessageName

The name of TOutput message.

string outputMessageType

MIME type of TOutput message.

Returns
Type Description
MessageHandler.Builder

This builder.

Type Parameters
Name Description
TInput

The type of the input message.

TOutput

The type of the output message.

| Edit this page View Source

Build()

Constructs message handler based on registered delegates.

Declaration
public MessageHandler Build()
Returns
Type Description
MessageHandler

The constructed message handler.

| Edit this page View Source

Reset()

Clears this builder so it can be reused.

Declaration
public void Reset()

Implements

ISupplier<TResult>
IFunctional<TDelegate>
IResettable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾