Table of Contents

Class AnyProtocolBus

Namespace
AnyProtocol
Assembly
AnyProtocol.dll

Coordinates inbound subscriptions and bus lifecycle operations.

public sealed class AnyProtocolBus : IAnyProtocolBus, IAsyncDisposable
Inheritance
AnyProtocolBus
Implements
Inherited Members

Constructors

AnyProtocolBus(RuntimePlan, TransportRegistry, MessageDispatcher, IRequestAdmission?, ShutdownOptions?, ILogWriterFactory?, OutboundOperationLifetime?)

Initializes a new instance of the AnyProtocolBus class.

public AnyProtocolBus(RuntimePlan runtimePlan, TransportRegistry transports, MessageDispatcher dispatcher, IRequestAdmission? admission = null, ShutdownOptions? shutdownOptions = null, ILogWriterFactory? logWriterFactory = null, OutboundOperationLifetime? outboundLifetime = null)

Parameters

runtimePlan RuntimePlan

The immutable runtime plan.

transports TransportRegistry

The transports.

dispatcher MessageDispatcher

The dispatcher.

admission IRequestAdmission

The shared request admission coordinator.

shutdownOptions ShutdownOptions

The bounded shutdown policy.

logWriterFactory ILogWriterFactory

The logging writer factory.

outboundLifetime OutboundOperationLifetime

The cancellation boundary for outbound operations.

Properties

IsStarted

Gets a value indicating whether the bus is started.

public bool IsStarted { get; }

Property Value

bool

true when the bus is started; otherwise, false.

State

Gets the current state of the component.

public AnyProtocolBusState State { get; }

Property Value

AnyProtocolBusState

The state.

Methods

DisposeAsync()

Stops inbound work and releases subscriptions and transports.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous operation.

StartAsync(CancellationToken)

Starts inbound transport subscriptions.

public ValueTask StartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token used to cancel startup.

Returns

ValueTask

A task that represents the asynchronous operation.

StopAsync(CancellationToken)

Stops accepting messages and drains inbound work.

public ValueTask StopAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token used to cancel the graceful drain.

Returns

ValueTask

A task that represents the asynchronous operation.