theY4Kman/dcrf-client

Pagination Support

jhillacre opened this issue · 0 comments

A merged djangochannelsrestframework pull request, NilCoalescing/djangochannelsrestframework#71, adds pagination support. It would be nice if dcrf-client got updated to provide handling of this. (Also, see NilCoalescing/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.