This is a major refactoring of the codebase. I was getting annoyed having to create extremely large files for small variants in MethodBuilders:
AsyncTaskMethodBuilder
AsyncTaskMethodBuilderT
AsyncValueTaskMethodBuilder
AsyncValueTaskMethodBuilderT
PoolingAsyncValueTaskMethodBuilder
PoolingAsyncValueTaskMethodBuilderT
With this large refactor we've been able to only need to implement the Run methods and inherit from a base class. Additional implementations of MergeSources and Source for type inference.
With that we have a few new CEs:
taskUnit which will return a Task
backgroundTaskUnit which will return a Task but will run on the threadpool
valueTaskUnit which will return a ValueTask
cancellablePoolingValueTask which will return a ValueTask<'T>
Also I've added a Polyfill namespace for fixing things in FSharp.Core that haven't made it upstream such as #31/https://github.com/dotnet/fsharp/issues/16189. You can open IcedTasks.Polyfill to shadow usages of task { }
Removed backgroundValueTask variants as they made no sense to actually have.
I'm also testing some Dynamic and Background implementations but not all of them.
Types of changes
What types of changes does your code introduce to IcedTasks?
Put an x in the boxes that apply
[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
[x] Build and tests pass locally
[x] I have added tests that prove my fix is effective or that my feature works (if appropriate)
[ ] I have added necessary documentation (if appropriate)
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
Proposed Changes
This is a major refactoring of the codebase. I was getting annoyed having to create extremely large files for small variants in MethodBuilders:
With this large refactor we've been able to only need to implement the
Run
methods and inherit from a base class. Additional implementations ofMergeSources
andSource
for type inference.With that we have a few new CEs:
taskUnit
which will return aTask
backgroundTaskUnit
which will return aTask
but will run on the threadpoolvalueTaskUnit
which will return aValueTask
cancellablePoolingValueTask
which will return aValueTask<'T>
Also I've added a
Polyfill
namespace for fixing things in FSharp.Core that haven't made it upstream such as #31/https://github.com/dotnet/fsharp/issues/16189. You can openIcedTasks.Polyfill
to shadow usages oftask { }
Removed
backgroundValueTask
variants as they made no sense to actually have.I'm also testing some Dynamic and Background implementations but not all of them.
Types of changes
What types of changes does your code introduce to IcedTasks? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...