News for hackers. Stuff that matters.
Re:Paginating Requests in APIs (2020) by jayd16 on Saturday May 28, 2022 @03:59PM (#31543255)
>Probably the nicest way to expose this that fits contemporary sensibilities would be as a lazy sequence that does sensible prefetching and asks the server for more data as it’s iterated through.

gRPC's streaming API is a good example. It has backpressure built in and you just need to configure the buffer sizes. Clients just consume items off the stream and async writes will suspend as needed.

There are no comments on this comment yet.