-
Notifications
You must be signed in to change notification settings - Fork 492
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
Conversation
This change requires we copy some internal code from the Azure.Core library, but the public facing classes are the Azure.Core defined classes.
Co-authored-by: David R. Williamson <[email protected]>
This reverts commit ce9e37f.
…csharp into timtay/AsyncPageable
/azp run |
...sioning/service/samples/getting started/CleanupEnrollmentsSample/CleanupEnrollmentsSample.cs
Outdated
Show resolved
Hide resolved
cancellationToken) | ||
.ConfigureAwait(false); | ||
|
||
Stream responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); |
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.
Does this need a using
?
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.
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.
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.
Because it is part of QueryResponse, which is also IDisposable?
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.
Is there an E2E test or a sample that shows how to dispose it?
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Add samples in xml docs for disposing when iterating by page, make sure we are following that pattern in our samples/e2e tests |
Have the sample xml docs not print out the raw individual enrollment type class. Print out something interesting instead |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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 changeI also change all the
CreateAsync
Query APIs to justCreate
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.