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
runtimePlanRuntimePlanThe immutable runtime plan.
transportsTransportRegistryThe transports.
dispatcherMessageDispatcherThe dispatcher.
admissionIRequestAdmissionThe shared request admission coordinator.
shutdownOptionsShutdownOptionsThe bounded shutdown policy.
logWriterFactoryILogWriterFactoryThe logging writer factory.
outboundLifetimeOutboundOperationLifetimeThe 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
cancellationTokenCancellationTokenThe 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
cancellationTokenCancellationTokenThe token used to cancel the graceful drain.
Returns
- ValueTask
A task that represents the asynchronous operation.