-
Notifications
You must be signed in to change notification settings - Fork 283
Design a pageable solution for list operations #341
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
Comments
I think the solution we are currently using is good: we simply return a azure-sdk-for-rust/sdk/storage/src/blob/container/requests/list_blobs_builder.rs Lines 132 to 166 in 881f5c5
We used to expose both the streaming and non streaming functions (as seen above) but we are discussing with @yoshuawuyts in #340 if we should only offer the streaming function from now on. @yoshuawuyts, @rylev should consider this more? I didn't think about it before but a streaming function can be difficult to work with due to lifetimes. |
How easily can that be extracted? In so our other SDKs, implementations really only need to provide a way to get the next link or page token, and there are helpers because there's a couple very common ways...by design: services are supposed to do it one way for new APIs anyway. What you said there seems very involved. I assume want every implementation to have to write that code. Harder to maintain, not to mention harder to improve centrally if needs be. |
It seems like this thread touches on several topics which may be useful to tease apart:
External APIRight now code reuse between implementationsI certainly hope we can reuse code between implementations, but having worked on #340 it might prove to be non-trivial. In yesterday's meeting we touched on this topic, and it seems like there's definitely a desire to. Regardless whether we expose ConclusionI'd like to propose that once we merge #346 and #340, we look at creating a shared abstraction. Ideally we could expose some equivalent to Does that sounds reasonable? |
All of the generated services that have operation responses with Azure SDK for CPP has a Azure SDK for JavaScript has: import { PagedAsyncIterableIterator } from "@azure/core-paging"; and a new experimental Azure Rest Core Paging library. Azure SDK for Go has done it a couple of ways. |
We might want some heuristic scanning as well. I can't say for sure for this Microsoft swagger extensions, but for some other extensions some services aren't always so consistent. That said, if other languages' generators use only this I see no reason to be different and try to support more. |
Basic guidelines here: azure_core::Pageable was added in #534. |
Closing, since |
Like in our other languages' SDKs, we need a solution like
Pageable<T>
that can fetch more pages as needed. It should do so automatically while providing callers the ability to fetch page by page if they wish to.Ideally needed for #218
The text was updated successfully, but these errors were encountered: