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

Paging LROs should return a poller #944

Open
deyaaeldeen opened this issue May 13, 2021 · 3 comments
Open

Paging LROs should return a poller #944

deyaaeldeen opened this issue May 13, 2021 · 3 comments
Assignees
Milestone

Comments

@deyaaeldeen
Copy link
Member

deyaaeldeen commented May 13, 2021

Some APIs are both LROs and the response is pageable. Combining these two features is challenging. Currently, we only generate a method that returns async iterator over pageable results and has the suffix AndWait. However, we also need to generate for these APIs another overload that does not have this suffix and returns a poller which eventually will return the async iterator.

@deyaaeldeen
Copy link
Member Author

deyaaeldeen commented Aug 12, 2021

This could be done by taking advantage of the processResult function in the options bag in the LroEngine class. Text Analytics has an example for such function that processes a pageable results with getPagedAsyncIterator here: https://github.com/Azure/azure-sdk-for-js/blob/b8f21fc9ca3675c73f6eea6ba0942eeb8084309d/sdk/textanalytics/ai-text-analytics/src/healthLro.ts#L182-L227

@sarangan12 sarangan12 added the P3 label Aug 18, 2021
@joheredi
Copy link
Member

joheredi commented Oct 6, 2021

Currently we are generating a Short LRO method for these operations that combine Paging + LRO which are suffixed with AndWait, these would pollUntilDone internally and give back the PagedAsyncIterator.

Implementing this would generate an additional method without the AndWait suffix, and keep the Short LRO one. So this would be an additive change and not a breaking change.

I can see this change split in 2 phases

  1. Make a change to cswitch to the new paging getPagedAsyncIterator which would help remove most of the private methods we are generating. This would be a non-breaking change.
  2. implement what Deya referenced above

@deyaaeldeen do you think the assesement above is accurate?

@deyaaeldeen
Copy link
Member Author

@joheredi Yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants