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(); } }
private void OnStopped() { RabbitMQListener.Stop(); }