public void Dispose()
 {
     _aborted?.Dispose();
     _aborted = null;
     _timer?.Dispose();
     _timer = null;
 }
        private async Task StopAsync(bool cancel, TimeSpan?delay)
        {
            _timer.Dispose();
            _timer = null;
            if (cancel)
            {
                if (delay > TimeSpan.Zero)
                {
                    _aborted.CancelAfter(delay.Value);
                }
                else
                {
                    _aborted.Cancel();
                }
            }

            await Task.WhenAll(_warps.Select(s => s.Task));

            await _transport.Flush();
        }