Giter VIP home page Giter VIP logo

Comments (8)

yassirh avatar yassirh commented on May 27, 2024

I set the per_page to PHP_INT_MAX so we can get all the possible values with just one request otherwise which is cheaper than going page by page. the instances where pagination would break is when someone have a large amount of data but I'm not sure you can get more than a few dozens of Kb... nevertheless we would still need to implement pagination. do you have any suggestions on how to tackle it ?

from client.

GrahamCampbell avatar GrahamCampbell commented on May 27, 2024

That's one of the things i'm having trouble with in my packages too. :/

from client.

GrahamCampbell avatar GrahamCampbell commented on May 27, 2024

I'm going to take a look at how the aws sdk for php does it.

from client.

GrahamCampbell avatar GrahamCampbell commented on May 27, 2024

Since you're using guzzle 3, you can do the same as the aws sdk does, and use: https://github.com/guzzle/service/blob/master/Resource/ResourceIterator.php. I'm using guzzle 4 for my problem though. :/

from client.

jpg5f2 avatar jpg5f2 commented on May 27, 2024

I see it is using a static 200 now, but the actual page is not being specific, limiting users to 200 droplets. Should a page parameter be added to droplet getAll?

from client.

Teevio avatar Teevio commented on May 27, 2024

Does this issue apply anymore? The $per_page and $page variables exist for the getAll function.

from client.

GrahamCampbell avatar GrahamCampbell commented on May 27, 2024

The issue was rather about automatic pagination, so we could get all, and then the library would iterate over all the pages for us.

from client.

cam-vanorman avatar cam-vanorman commented on May 27, 2024

This issue appears to still be under discussion, so I thought I'd add some more info.

When querying https://api.digitalocean.com/v2/droplets, the DigitalOcean API returns a meta object with total key.

Screen Shot 2019-10-03 at 6 34 33 PM

Retaining this meta value at the end of the getAll() request would make paginating the API much easier with this library and the package @GrahamCampbell developed (https://github.com/GrahamCampbell/Laravel-DigitalOcean).

If anyone has suggestions for paginating the API rather than setting a high $per_page variable, I'm all 👂.

from client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.