Skip to content

Conversation

@snaumenko-st
Copy link

Introduce IAsyncEnumerable on DelayedQuery to utilize async Session query while asynchronously prefetching data.

@SergeiPavlov
Copy link
Collaborator

SergeiPavlov commented Dec 19, 2023

Looks like it duplicates
DelayedQuery.ExecuteAsync().AsAsyncEnumerable() functionality

Generally we add a new code into DataObject only when it is impossible or difficult to get the the result by existing DO API.

@snaumenko-st
Copy link
Author

We need IAsyncEnumerable implementation here as if it is used inside a Prefetch, which is a fairly common case, it is used as the IEnumerable source and will fall back to a synchronous implementation even in a chain of asynchronous calls. The new unit test shows that behavior.

@SergeiPavlov
Copy link
Collaborator

You are right

@SergeiPavlov
Copy link
Collaborator

@snaumenko-st could you please create a clone of this PR into the Upstream repo https://github.com/dataObjects-net/dataobjects-net ?

@SergeiPavlov SergeiPavlov merged commit 5036833 into master-servicetitan Dec 20, 2023
@SergeiPavlov SergeiPavlov deleted the asyncQueryFix branch December 20, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants