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

Handle iteration/next_token automatically #1319

Open
matthewkmayer opened this issue Mar 29, 2019 · 14 comments · May be fixed by #1866
Open

Handle iteration/next_token automatically #1319

matthewkmayer opened this issue Mar 29, 2019 · 14 comments · May be fixed by #1866

Comments

@matthewkmayer
Copy link
Member

#1031 showed a great idea for implementing an iterator for calls that can return multiple pages of results. Right now, Rusoto requires users to handle paging themselves. The S3 integration tests have examples of having to implement this as a user of Rusoto.

It'd be 💯 to have Rusoto take care of paging behind the scenes and expose an iterator interface to results that can have multiple pages.

@softprops
Copy link
Contributor

I'd be willing to give this a shot. I've had experience doing this is dynomite, a dynamodb crate using a futures::Stream based model. I'd be happy to port that into rusoto code gen.

@andrewbanchich
Copy link
Contributor

Hey @matthewkmayer , I actually just finished implementing this for S3 results for a personal project and came here to see if it would be okay if I made a pull request for it.

@matthewkmayer
Copy link
Member Author

That'd be awesome! 👍

@andrewbanchich
Copy link
Contributor

It's just for S3 results though, but it looks like you'd probably want something programmatically generated for the entire library?

@matthewkmayer
Copy link
Member Author

Correct: we'll want it across all services.

Seeing an example of it working can help us figure out a solution. 😄

@softprops
Copy link
Contributor

Heads up I've already got a branch going with a stream::unfold approach leveraging botocores paginator descriptors. I could push up a prelim pr with a wip of that would be helpful.

@srijs
Copy link
Contributor

srijs commented Apr 11, 2019

@softprops happy to look over that and provide feedback if you want to push that!

@matthewkmayer
Copy link
Member Author

@andrewbanchich I'm booked up the next few weeks, but we could work something out. If possible, a code snippet of how you're using the iterators would be 💯 and an example implementation. I wouldn't spend too much time on the snippets since @softprops has work in progress that'll cover all services.

@andrewbanchich
Copy link
Contributor

@matthewkmayer Here's a snippet of what I got working for my project. I'd love any feedback if there is a better way of doing anything.

I also added a bunch of helper impls for the Bucket type for get/put/list actions.

@softprops
Copy link
Contributor

Approach I'm taking is lifting https://github.com/softprops/dynomite/blob/master/dynomite/src/ext.rs#L53 into something that's paginator definition generated

@0xjjoyy
Copy link

0xjjoyy commented Feb 22, 2020

Is there a target milestone for pagination?

@aj-bagwell
Copy link

I have rebased @softprops work onto master and finished off the JMESPath stuff for some of the stranger pagination definitions.

@Kintaro
Copy link

Kintaro commented Jan 19, 2021

Are there any updates on the progress?

@aj-bagwell
Copy link

I have updated my pull request with the latest master, but until #1651 is sorted out and there is a new maintainer who can review a change of this size I don't think this will get merged.

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