Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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;
        }