public async IAsyncEnumerable <Message> Messages([EnumeratorCancellation] CancellationToken cancellationToken) { ThrowIfDisposed(); while (!cancellationToken.IsCancellationRequested) { yield return(await _executor.Execute(() => _channel.Receive(cancellationToken), cancellationToken)); } }
private async ValueTask <Message> Receive(CancellationToken cancellationToken) => await _channel.Receive(cancellationToken).ConfigureAwait(false);