Example #1
0
        public async IAsyncEnumerable <Message> Messages([EnumeratorCancellation] CancellationToken cancellationToken)
        {
            ThrowIfDisposed();

            while (!cancellationToken.IsCancellationRequested)
            {
                yield return(await _executor.Execute(() => _channel.Receive(cancellationToken), cancellationToken));
            }
        }
Example #2
0
 private async ValueTask <Message> Receive(CancellationToken cancellationToken)
 => await _channel.Receive(cancellationToken).ConfigureAwait(false);