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

Move to static members and overloads, to support cancellation token passing, ValueTask and Async in the module members #184

Closed
abelbraaksma opened this issue Oct 30, 2023 · 2 comments
Labels
enhancement New feature or request topic: surface area Adds functions to the public surface area
Milestone

Comments

@abelbraaksma
Copy link
Member

abelbraaksma commented Oct 30, 2023

It is currently quite a pain to implement cancellation passing explicitly. As has been said in several issues already, we need to support this on each member to do it properly. Plus we will need overloads:

  • Each method taking a TaskSeq should also seamlessly take a ConfiguredCancelableAsyncEnumerable<_>, which is available in .NET Standard 2.1. This would solve Support ConfiguredCancelableAsyncEnumerable<'T> #167, reported by @xperiandri (PS: to prevent the surface area to blow up, I will check if ofCancelable/toCancelable functions would serve the same purpose).
  • Each method currently with the Async prefix should be able to take a Task (as they can, currently), an Async and a ValueTask. Writing functions like iterAsync, iterWithTask, iterWithValueTask etc is going to be too painful long-run.
  • Each method should have an optional cancellation token argument as their last argument (?), so that piping into the functions is still possible, but it will default to no cancellation token. Only members that consume the task sequence should get a cancellation token argument.
@abelbraaksma
Copy link
Member Author

Some more original discussion can be found here: #133.

@abelbraaksma abelbraaksma added enhancement New feature or request topic: surface area Adds functions to the public surface area labels Oct 31, 2023
@abelbraaksma
Copy link
Member Author

This change has meanwhile been merged into main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic: surface area Adds functions to the public surface area
Projects
None yet
Development

No branches or pull requests

1 participant