Skip to content
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

Utilize AsyncPageable for DPS query return types #3176

Merged
merged 37 commits into from
Mar 23, 2023

Conversation

timtay-microsoft
Copy link
Member

@timtay-microsoft timtay-microsoft commented Mar 20, 2023

see #3165, but for the DPS service client this time.

This PR also removes some superfluous classes like ContractApiResponse since they were needless abstractions that made it harder to implement this change

I also change all the CreateAsync Query APIs to just Create since the function itself is not async. The first service request isn't made until the iteration begins.

I also removed the IContractApiHttp interface since it only had one implementation and we don't currently allow users to override this implementation in any way.

@timtay-microsoft
Copy link
Member Author

/azp run

cancellationToken)
.ConfigureAwait(false);

Stream responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a using?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because it is given to the user to view as part of the Response<T> pattern that AsyncEnumerable uses. It is the user's responsibility to dispose the stream here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is part of QueryResponse, which is also IDisposable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an E2E test or a sample that shows how to dispose it?

@timtay-microsoft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timtay-microsoft
Copy link
Member Author

Add samples in xml docs for disposing when iterating by page, make sure we are following that pattern in our samples/e2e tests

@timtay-microsoft
Copy link
Member Author

Have the sample xml docs not print out the raw individual enrollment type class. Print out something interesting instead

@timtay-microsoft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timtay-microsoft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timtay-microsoft timtay-microsoft merged commit 99c559c into previews/v2 Mar 23, 2023
@timtay-microsoft timtay-microsoft deleted the timtay/asyncProv branch March 23, 2023 03:10
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