public async Task Stop(CancellationToken cancellationToken) { LogContext.Current = _hostConfiguration.LogContext; await _riderCollection.Stop(cancellationToken).ConfigureAwait(false); await ReceiveEndpoints.Stop(cancellationToken).ConfigureAwait(false); foreach (var agent in GetAgentHandles()) { await agent.Stop("Host stopped", cancellationToken).ConfigureAwait(false); } _handle = null; }
public async Task Stop(CancellationToken cancellationToken) { LogContext.Current = _hostConfiguration.LogContext; LogContext.Debug?.Log("Stopping bus: {HostAddress}", Address); await Riders.Stop(cancellationToken).ConfigureAwait(false); await ReceiveEndpoints.Stop(cancellationToken).ConfigureAwait(false); foreach (var agent in GetAgentHandles()) { await agent.Stop("Bus stopped", cancellationToken).ConfigureAwait(false); } _handle = null; }