Table of Contents

Struct MessageBrokerServerOptions

Namespace
LfrlAnvil.MessageBroker.Server
Assembly
LfrlAnvil.MessageBroker.Server.dll

Represents available MessageBrokerServer creation options.

public readonly record struct MessageBrokerServerOptions : IEquatable<MessageBrokerServerOptions>
Implements
Inherited Members

Constructors

MessageBrokerServerOptions(string?, MessageBrokerServerTcpOptions, MessageBrokerServerNetworkPacketOptions, Duration?, Bounds<Duration>?, Bounds<Duration>?, IParsedExpressionFactory?, Func<MessageBrokerRemoteClient, ITimestampProvider>?, Func<MessageBrokerRemoteClient, ValueTaskDelaySource>?, MessageBrokerServerLogger?, Func<MessageBrokerRemoteClient, MessageBrokerRemoteClientLogger?>?, Func<MessageBrokerChannel, MessageBrokerChannelLogger?>?, Func<MessageBrokerStream, MessageBrokerStreamLogger?>?, Func<MessageBrokerQueue, MessageBrokerQueueLogger?>?, MessageBrokerRemoteClientStreamDecorator?)

Represents available MessageBrokerServer creation options.

public MessageBrokerServerOptions(string? RootStoragePath, MessageBrokerServerTcpOptions Tcp, MessageBrokerServerNetworkPacketOptions NetworkPacket, Duration? HandshakeTimeout, Bounds<Duration>? AcceptableMessageTimeout, Bounds<Duration>? AcceptablePingInterval, IParsedExpressionFactory? ExpressionFactory, Func<MessageBrokerRemoteClient, ITimestampProvider>? TimestampsFactory, Func<MessageBrokerRemoteClient, ValueTaskDelaySource>? DelaySourceFactory, MessageBrokerServerLogger? Logger, Func<MessageBrokerRemoteClient, MessageBrokerRemoteClientLogger?>? ClientLoggerFactory, Func<MessageBrokerChannel, MessageBrokerChannelLogger?>? ChannelLoggerFactory, Func<MessageBrokerStream, MessageBrokerStreamLogger?>? StreamLoggerFactory, Func<MessageBrokerQueue, MessageBrokerQueueLogger?>? QueueLoggerFactory, MessageBrokerRemoteClientStreamDecorator? StreamDecorator)

Parameters

RootStoragePath string

Specifies the root path for permanent server storage. Lack of root path will cause the server to work in in-memory mode. Disabled by default.

Tcp MessageBrokerServerTcpOptions

Available TcpClient options.

NetworkPacket MessageBrokerServerNetworkPacketOptions

Available network packet options.

HandshakeTimeout Duration?

Handshake timeout for newly connected clients. Equal to 15 seconds by default. Sub-millisecond components will be trimmed. Value will be clamped to [1 ms, 2147483647 ms] range.

AcceptableMessageTimeout Bounds<Duration>?

Range of acceptable send or receive message timeout values. Equal to [1 ms, 2147483647 ms] by default. Sub-millisecond components will be trimmed. Values will be clamped to [1 ms, 2147483647 ms] range.

AcceptablePingInterval Bounds<Duration>?

Range of acceptable send ping interval values. Equal to [1 ms, 24 hours] by default. Sub-millisecond components will be trimmed. Values will be clamped to [1 ms, 24 hours] range.

ExpressionFactory IParsedExpressionFactory

Factory of parsed expressions for listener message filter predicates.

TimestampsFactory Func<MessageBrokerRemoteClient, ITimestampProvider>

Factory of Timestamp providers.

DelaySourceFactory Func<MessageBrokerRemoteClient, ValueTaskDelaySource>

Factory of ValueTaskDelaySource instances used for scheduling future events.

Logger MessageBrokerServerLogger?

MessageBrokerServerLogger instance.

ClientLoggerFactory Func<MessageBrokerRemoteClient, MessageBrokerRemoteClientLogger?>

Factory of MessageBrokerRemoteClientLogger instances.

ChannelLoggerFactory Func<MessageBrokerChannel, MessageBrokerChannelLogger?>

Factory of MessageBrokerChannelLogger instances.

StreamLoggerFactory Func<MessageBrokerStream, MessageBrokerStreamLogger?>

Factory of MessageBrokerStreamLogger instances.

QueueLoggerFactory Func<MessageBrokerQueue, MessageBrokerQueueLogger?>

Factory of MessageBrokerQueueLogger instances.

StreamDecorator MessageBrokerRemoteClientStreamDecorator

MessageBrokerRemoteClientStreamDecorator callback.

Properties

AcceptableMessageTimeout

Range of acceptable send or receive message timeout values. Equal to [1 ms, 2147483647 ms] by default. Sub-millisecond components will be trimmed. Values will be clamped to [1 ms, 2147483647 ms] range.

public Bounds<Duration>? AcceptableMessageTimeout { get; init; }

Property Value

Bounds<Duration>?

AcceptablePingInterval

Range of acceptable send ping interval values. Equal to [1 ms, 24 hours] by default. Sub-millisecond components will be trimmed. Values will be clamped to [1 ms, 24 hours] range.

public Bounds<Duration>? AcceptablePingInterval { get; init; }

Property Value

Bounds<Duration>?

ChannelLoggerFactory

Factory of MessageBrokerChannelLogger instances.

public Func<MessageBrokerChannel, MessageBrokerChannelLogger?>? ChannelLoggerFactory { get; init; }

Property Value

Func<MessageBrokerChannel, MessageBrokerChannelLogger?>

ClientLoggerFactory

Factory of MessageBrokerRemoteClientLogger instances.

public Func<MessageBrokerRemoteClient, MessageBrokerRemoteClientLogger?>? ClientLoggerFactory { get; init; }

Property Value

Func<MessageBrokerRemoteClient, MessageBrokerRemoteClientLogger?>

Default

Represents default options.

public static MessageBrokerServerOptions Default { get; }

Property Value

MessageBrokerServerOptions

DelaySourceFactory

Factory of ValueTaskDelaySource instances used for scheduling future events.

public Func<MessageBrokerRemoteClient, ValueTaskDelaySource>? DelaySourceFactory { get; init; }

Property Value

Func<MessageBrokerRemoteClient, ValueTaskDelaySource>

ExpressionFactory

Factory of parsed expressions for listener message filter predicates.

public IParsedExpressionFactory? ExpressionFactory { get; init; }

Property Value

IParsedExpressionFactory

HandshakeTimeout

Handshake timeout for newly connected clients. Equal to 15 seconds by default. Sub-millisecond components will be trimmed. Value will be clamped to [1 ms, 2147483647 ms] range.

public Duration? HandshakeTimeout { get; init; }

Property Value

Duration?

Logger

public MessageBrokerServerLogger? Logger { get; init; }

Property Value

MessageBrokerServerLogger?

NetworkPacket

Available network packet options.

public MessageBrokerServerNetworkPacketOptions NetworkPacket { get; init; }

Property Value

MessageBrokerServerNetworkPacketOptions

QueueLoggerFactory

Factory of MessageBrokerQueueLogger instances.

public Func<MessageBrokerQueue, MessageBrokerQueueLogger?>? QueueLoggerFactory { get; init; }

Property Value

Func<MessageBrokerQueue, MessageBrokerQueueLogger?>

RootStoragePath

Specifies the root path for permanent server storage. Lack of root path will cause the server to work in in-memory mode. Disabled by default.

public string? RootStoragePath { get; init; }

Property Value

string

StreamDecorator

public MessageBrokerRemoteClientStreamDecorator? StreamDecorator { get; init; }

Property Value

MessageBrokerRemoteClientStreamDecorator

StreamLoggerFactory

Factory of MessageBrokerStreamLogger instances.

public Func<MessageBrokerStream, MessageBrokerStreamLogger?>? StreamLoggerFactory { get; init; }

Property Value

Func<MessageBrokerStream, MessageBrokerStreamLogger?>

Tcp

Available TcpClient options.

public MessageBrokerServerTcpOptions Tcp { get; init; }

Property Value

MessageBrokerServerTcpOptions

TimestampsFactory

Factory of Timestamp providers.

public Func<MessageBrokerRemoteClient, ITimestampProvider>? TimestampsFactory { get; init; }

Property Value

Func<MessageBrokerRemoteClient, ITimestampProvider>

Methods

SetAcceptableMessageTimeout(Bounds<Duration>?)

Allows to change AcceptableMessageTimeout.

[Pure]
public MessageBrokerServerOptions SetAcceptableMessageTimeout(Bounds<Duration>? value)

Parameters

value Bounds<Duration>?

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetAcceptablePingInterval(Bounds<Duration>?)

Allows to change AcceptablePingInterval.

[Pure]
public MessageBrokerServerOptions SetAcceptablePingInterval(Bounds<Duration>? value)

Parameters

value Bounds<Duration>?

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetChannelLoggerFactory(Func<MessageBrokerChannel, MessageBrokerChannelLogger?>?)

Allows to change ChannelLoggerFactory.

[Pure]
public MessageBrokerServerOptions SetChannelLoggerFactory(Func<MessageBrokerChannel, MessageBrokerChannelLogger?>? value)

Parameters

value Func<MessageBrokerChannel, MessageBrokerChannelLogger?>

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetClientLoggerFactory(Func<MessageBrokerRemoteClient, MessageBrokerRemoteClientLogger?>?)

Allows to change ClientLoggerFactory.

[Pure]
public MessageBrokerServerOptions SetClientLoggerFactory(Func<MessageBrokerRemoteClient, MessageBrokerRemoteClientLogger?>? value)

Parameters

value Func<MessageBrokerRemoteClient, MessageBrokerRemoteClientLogger?>

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetDelaySourceFactory(Func<MessageBrokerRemoteClient, ValueTaskDelaySource>?)

Allows to change DelaySourceFactory.

[Pure]
public MessageBrokerServerOptions SetDelaySourceFactory(Func<MessageBrokerRemoteClient, ValueTaskDelaySource>? value)

Parameters

value Func<MessageBrokerRemoteClient, ValueTaskDelaySource>

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetExpressionFactory(IParsedExpressionFactory?)

Allows to change ExpressionFactory.

[Pure]
public MessageBrokerServerOptions SetExpressionFactory(IParsedExpressionFactory? value)

Parameters

value IParsedExpressionFactory

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetHandshakeTimeout(Duration?)

Allows to change HandshakeTimeout.

[Pure]
public MessageBrokerServerOptions SetHandshakeTimeout(Duration? value)

Parameters

value Duration?

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetLogger(MessageBrokerServerLogger?)

Allows to change Logger.

[Pure]
public MessageBrokerServerOptions SetLogger(MessageBrokerServerLogger? value)

Parameters

value MessageBrokerServerLogger?

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetNetworkPacketOptions(MessageBrokerServerNetworkPacketOptions)

Allows to change NetworkPacket.

[Pure]
public MessageBrokerServerOptions SetNetworkPacketOptions(MessageBrokerServerNetworkPacketOptions value)

Parameters

value MessageBrokerServerNetworkPacketOptions

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetQueueLoggerFactory(Func<MessageBrokerQueue, MessageBrokerQueueLogger?>?)

Allows to change QueueLoggerFactory.

[Pure]
public MessageBrokerServerOptions SetQueueLoggerFactory(Func<MessageBrokerQueue, MessageBrokerQueueLogger?>? value)

Parameters

value Func<MessageBrokerQueue, MessageBrokerQueueLogger?>

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetRootStoragePath(string?)

Allows to change RootStoragePath.

[Pure]
public MessageBrokerServerOptions SetRootStoragePath(string? value)

Parameters

value string

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetStreamDecorator(MessageBrokerRemoteClientStreamDecorator?)

Allows to change StreamDecorator.

[Pure]
public MessageBrokerServerOptions SetStreamDecorator(MessageBrokerRemoteClientStreamDecorator? value)

Parameters

value MessageBrokerRemoteClientStreamDecorator

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetStreamLoggerFactory(Func<MessageBrokerStream, MessageBrokerStreamLogger?>?)

Allows to change StreamLoggerFactory.

[Pure]
public MessageBrokerServerOptions SetStreamLoggerFactory(Func<MessageBrokerStream, MessageBrokerStreamLogger?>? value)

Parameters

value Func<MessageBrokerStream, MessageBrokerStreamLogger?>

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetTcpOptions(MessageBrokerServerTcpOptions)

Allows to change Tcp.

[Pure]
public MessageBrokerServerOptions SetTcpOptions(MessageBrokerServerTcpOptions value)

Parameters

value MessageBrokerServerTcpOptions

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.

SetTimestampsFactory(Func<MessageBrokerRemoteClient, ITimestampProvider>?)

Allows to change TimestampsFactory.

[Pure]
public MessageBrokerServerOptions SetTimestampsFactory(Func<MessageBrokerRemoteClient, ITimestampProvider>? value)

Parameters

value Func<MessageBrokerRemoteClient, ITimestampProvider>

New value.

Returns

MessageBrokerServerOptions

New MessageBrokerServerOptions instance.