Пример #1
0
        public async ValueTask DisposeAsync()
        {
            _heartbeat?.Dispose();
            await Writer.DisposeAsync().ConfigureAwait(false);

            await Reader.DisposeAsync().ConfigureAwait(false);

            //_ctx.Abort();
            _cts.Cancel();
            await _ctx.DisposeAsync().ConfigureAwait(false);

            _listener.Stop();
            CancelTcs();
            if (!_connectionCloseOkSrc.Task.IsCompleted && !_connectionCloseOkSrc.Task.IsCanceled)
            {
                _connectionCloseOkSrc.SetCanceled();
            }
            if (!_connectionOpenOk.Task.IsCompleted && !_connectionOpenOk.Task.IsCanceled)
            {
                _connectionOpenOk.SetCanceled();
            }
            if (!ConnectionClosedSrc.Task.IsCompleted && !ConnectionClosedSrc.Task.IsCanceled)
            {
                ConnectionClosedSrc.SetCanceled();
            }
        }
Пример #2
0
 private void OnStopped()
 {
     RabbitMQListener.Stop();
 }