-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query: Adds asynchronous enumeration #4855
Open
seesharprun
wants to merge
12
commits into
Azure:master
Choose a base branch
from
seesharprun:async-enumerator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+477
−4
Conversation
This file contains 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
…ts. Dispose feed iterator in GetEnumerator
…se `CosmosLinqQuery<T>` instead of `IAsyncEnumerable<T>`
seesharprun
requested review from
khdang,
sboshra,
adityasa,
neildsh,
kirankumarkolli,
FabianMeiswinkel,
kirillg and
Pilchie
as code owners
October 25, 2024 22:42
seesharprun
changed the title
Implement asynchronous enumeration
[Feature]: Implement asynchronous enumeration
Oct 25, 2024
seesharprun
changed the title
[Feature]: Implement asynchronous enumeration
Adds: asynchronous enumeration
Oct 25, 2024
seesharprun
changed the title
Adds: asynchronous enumeration
Query: Adds asynchronous enumeration
Oct 25, 2024
It looks like these two tests are failing in the preview run:
|
I'm not sure why the preview tests are failing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I've always wanted to use the new
await foreach
and this PR is an attempt to implement theIAsyncEnumerable<>
interface in two places:As an interface for
FeedIterator<>
to give consumers another option for querying entitiesAs an extension method
AsAsyncEnumerable()
forCosmosLinqQuery<>
queriesThis is a pretty major lift, so I anticipate some major changes and opinionated reviews. This is based on @onionhammer work in #4355. I've implemented a few of the items of feedback from the engineering team:
First, I made sure you can get an asynchronous iterator from either the "LINQ" or "NoSQL query" options for a
Container
instance.Second, I added unit and emulator tests for both options. I was unable to mock the
CosmosLinqQuery<>
type because it was sealed, so I would appreciate guidance on unit testing for that scenario.Finally, I returned an
IAsyncEnumerable<FeedResponse<>>
. This balances between the convenience ofawait foreach
and the depth of reading response metadata/headers. Here's an example query:I also tried to be as verbose as possible with the XML comments so they can generate into the documentation with examples.
Type of change
Closing issues