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

AsyncEx #24

Merged
merged 4 commits into from
Jul 4, 2023
Merged

AsyncEx #24

merged 4 commits into from
Jul 4, 2023

Conversation

TheAngryByrd
Copy link
Owner

@TheAngryByrd TheAngryByrd commented Jul 4, 2023

Proposed Changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

This adds AsyncEx

  1. Allows use for IAsyncDisposable
  2. Allows let!/do! against Tasks/ValueTasks/any Awaitable
  3. When Tasks throw exceptions they will use the behavior described in Async.Await overload (esp. AwaitTask without throwing AggregateException

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)
  • New feature (non-breaking change which adds functionality)
  • 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.

  • Build and tests pass locally
  • 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...

@TheAngryByrd TheAngryByrd changed the title Asyncex AsyncEx Jul 4, 2023
@TheAngryByrd TheAngryByrd merged commit fce98ec into master Jul 4, 2023
TheAngryByrd added a commit that referenced this pull request Jul 4, 2023
## [0.7.0] - 2023-07-04

### Added
- [AsyncEx](#24) Credits @TheAngryByrd
onError e.InnerExceptions.[0]
else
onError e
elif task.IsCanceled then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheAngryByrd the official ATC calls onError, and does not wrapp the inner one
IIRC this has an important impact (the fssnip has tests that expose it). I cant recall whether the bit that breaks this way is

  1. Async.Parallel doesn't kill the siblings (as it;'s waiting for the first exception or something?)
  2. cancellation is not honored

IIRC there are two separate F# issues that cover the overall requirements (the AggregateException bit vs the Await Cancellation as Exception aspect)

My general conclusion is that we're better off having AwaitTaskCorrect, which has been very well battle proven, with specific failing tests covering any deviation from its entire behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants