-
Notifications
You must be signed in to change notification settings - Fork 21
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
Async.Await overload (esp. AwaitTask without throwing AggregateException) #840
Comments
If breaking AwaitTask it would be good to fix up another of it's oddities at the same time, that it can't be cancelled: dotnet/fsharp#7357 |
This is related to dotnet/fsharp#3257 |
@matthid I’ll agree that the “Correct” part has to go, I was just honoring the Original Poster of the snippet. The overload with a param that triggers the new behavior seems fine to me. I checked that PR real quick and I’m not sure if it is exactly this, but really related should have been merged 😱 How do you deal with this? Is there any library that compensates this design right now? |
I usually have some extension-methods to check for inner exceptions and/or unwrap the exception if needed |
I agree this should be solved. We need a better name - adding an optional argument seems reasonable though is a binary breaking change (though I believe it can be arranged that it's not a source breaking change on re-compilation). I will mark this as approved in principle - would be great to have it as a community-led contribution For the |
Related, and a potential alternative path (that is: a community led |
We need a better name. Perhaps if we had an overloaded Async.Await(task) overloaded with
I'll adjust the name of this suggestion |
Note that Is it wise to put all these overloads in |
We could add them symmetrically, similarly to how it is done for collection conversions Async.Await(ValueTask) |
I decided to add them in IcedTasks under |
What about other Async functions doing surprising wrapping of aggregate exceptions? For instance, I think we need something like:
Maybe I should create a separate issue. |
Think that's best covered under a separate issue (and revisiting |
I propose including AwaitTaskCorrect (maybe with another name)
The existing way of approaching this problem in F# is copying the snippet in your project, ref : jet/equinox#198
Pros and Cons
The advantages of making this adjustment to F#:
The disadvantages of making this adjustment to F# are:
Extra information
Estimated cost (XS, S, M, L, XL, XXL): No idea
Related suggestions: at this moment I don't know of any other related suggestions might edit in the future
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
The text was updated successfully, but these errors were encountered: