-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-3458: Extend IAsyncCursor and IAsyncCursorSource to support IAsyncEnumerable #1708
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
As far as I know |
public ValueTask DisposeAsync() | ||
{ | ||
Dispose(); | ||
return new ValueTask(Task.CompletedTask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be simply default
.
return _batchEnumerator.MoveNext(); | ||
} | ||
|
||
_batchEnumerator = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we dispose _batchEnumerator
here?
{ | ||
// private fields | ||
private readonly CancellationToken _cancellationToken; | ||
private readonly IAsyncCursorSource<TDocument> _source; | ||
|
||
// constructors | ||
public AsyncCursorSourceEnumerableAdapter(IAsyncCursorSource<TDocument> source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to call another constructor here, like:
: this(source, CancellationToken.None)
No description provided.