Created
October 14, 2020 08:39
-
-
Save stevejgordon/7fdbf30a33a38a2c7ffb139705546627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public virtual async IAsyncEnumerable<T> ReadAllAsync([EnumeratorCancellation] CancellationToken cancellationToken = default) | |
{ | |
while (await WaitToReadAsync(cancellationToken).ConfigureAwait(false)) | |
{ | |
while (TryRead(out T item)) | |
{ | |
yield return item; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment