dcrf-client icon indicating copy to clipboard operation
dcrf-client copied to clipboard

Pagination Support

Open jhillacre opened this issue 3 years ago • 0 comments

A merged djangochannelsrestframework pull request, hishnash/djangochannelsrestframework#71, adds pagination support. It would be nice if dcrf-client got updated to provide handling of this. (Also, see hishnash/djangochannelsrestframework#76)

With a StreamedPaginatedListMixin based Consumer, the response is broken up into pages, but the server does not wait for us to request pages. Therefore, to accommodate listing a StreamedPaginatedListMixin based consumer, the list operation should take a callback, similar to subscribe, where the library user can handle one page at a time. Additionally, we may need users, or djangochannelsrestframework, to have a custom paginator that returns the expected number of pages, so dcrf-client knows when to clean up the listener.

Listing a PaginatedListMixin based Consumer should work with dcrf-client as is, although it leaves going through all the pages to the library user. The listing callback could provide a function for library users to get the next page if there is one.

jhillacre avatar May 27 '21 20:05 jhillacre