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

IAsyncEnumerable<TItem> Continuation Token Paging Implementation #197

Open
mumby0168 opened this issue Jan 21, 2022 · 0 comments
Open

IAsyncEnumerable<TItem> Continuation Token Paging Implementation #197

mumby0168 opened this issue Jan 21, 2022 · 0 comments
Labels
help wanted Extra attention is needed up-for-grabs 🙏🏽 Happy to consider a pull review to address this issue

Comments

@mumby0168
Copy link
Collaborator

This library currently has a few paging implementations. None of which yet support streaming. It would be great to add one that returns an IAsyncEnumerable<TItem> for scenarios where data would benefit from being streamed. This is a great fit for use with continuation tokens.

A possible API might be something like below:

IAsyncEnumerable<TItem> PageAsync(
            Expression<Func<TItem, bool>> predicate = null,
            int? maxResults = null,
            int pageSize = 25,
            CancellationToken cancellationToken = default);

This could potentially allow a caller to either get all the results returned by the predicate or specify a limit of how many items they would like back.

This under the hood would make use of continuation tokens to provide efficient, cost-effective paging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed up-for-grabs 🙏🏽 Happy to consider a pull review to address this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant