TaskEx: AwaitTaskCorrect / Task.toAsync / Async.ofTask #141
Labels
feature request
New feature or enhancement request
topic: task-ex
Related to the proposed new TaskEx library, which should get its own oss haven
Milestone
Replaces #129. TaskEx top level issue: #139
The default implementation of the
Async.AwaitTask
methods inFSharp.Core
have some key shortcomings:Task
faults, yielding an exception, that exception is typically (always?) wrapped in an egregiousAggregateException
CancellationToken
of theasync
expr within whichAsync.AwaitTask
is triggeredTaskCancelledException
to align with the behavior ofTask
While it can be argued that the current behavior is 'wrong', it's also obvious that breaking it would be untenable, and the semantic differences are beyond what one might cover with subtle overloads and/or adding optional arguments etc.
Current proposed APIs (will be updated inline based on any discussion below):
NOTES:
TaskSeq
, which are exposed in theFSharp.Control
namespace. NOTE the current implementations useAsync.AwaitTask
, but that was not as a conscious choice, and there is a desire` to fix at least some of the shortcomings notedtask
andasync
are now first class citizens ofFSharp.Core
, having anof/to
pairing would seem to make sense. This is open to debate; not sure the degree to which the prior art is consistent wrt this beyond collection types/modulesfslang-suggestion
regarding this. The purpose of this issue is as a placeholder for potentially filling the gap until this issue can be more thoroughly resolved inFSharp.Core
proper.module
, one also frequently needs anofUnitTask
alongside as above (Async.AwaitTask is a pair of overloaded methods, which often brings its own issues with intellisense and error messages etc)The text was updated successfully, but these errors were encountered: