TaskEx: AwaitTaskCorrect / Task.toAsync / Async.ofTask
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- fsharp
- 領域
- backend
調査の方向性
まず、提案された API、置き換えられた issue 129 と 139、およびリンクされている fslang-suggestion を読みます。Equinox、Propulsion、FSharp.AWS.DynamoDB にある実装の標準的なコピーを比較します。共有実装に適した、合意済みの API とキャンセルおよび例外のセマンティクスが定まれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Replaces https://github.com/fsprojects/FSharp.Control.TaskSeq/issues/129. TaskEx top level issue: https://github.com/fsprojects/FSharp.Control.TaskSeq/issues/139
The default implementation of the Async.AwaitTask methods in FSharp.Core have some key shortcomings:
- when the
Taskfaults, yielding an exception, that exception is typically (always?) wrapped in an egregiousAggregateException - the default implementation does not abort/cancel when the ambient
CancellationTokenof theasyncexpr within whichAsync.AwaitTaskis triggered - cancelling an Async computation should not just abort the processing, it should also propagate a
TaskCancelledExceptionto 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):
module Async =
let inline ofTask (t : Task<'t>) : Async<'t> = AwaitTaskCorrect t
let inline ofUnitTask (t : Task) : Async<'t> = AwaitTaskCorrect t
module Task =
let inline toAsync (t : Task<'t>) : Async<'t> = Async.ofTask t
NOTES:
- the above naming is taken from the helpers within
TaskSeq, which are exposed in theFSharp.Controlnamespace. 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 noted - given the fact that
taskandasyncare now first class citizens ofFSharp.Core, having anof/topairing 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/modules - There is an
fslang-suggestionregarding this. The purpose of this issue is as a placeholder for potentially filling the gap until this issue can be more thoroughly resolved inFSharp.Coreproper. - Equinox, Propulsion and FSharp.AWS.DynamoDB all have copies of the canonical impl in Eirik's fssnip. Not ruling out tweaks to the semantics, but ideally those libraries, and others, would all share the same semantics
- if this is handled as a
module, one also frequently needs anofUnitTaskalongside as above (Async.AwaitTask is a pair of overloaded methods, which often brings its own issues with intellisense and error messages etc)
- 主要言語
- F#
- スター
- 111
- フォーク
- 13
- 平均マージ
- 7時間 59分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fsprojects/FSharp.Control.TaskSeq のほかの issue
-
agentic-workflows automation repo-assist
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
agentic-workflows automation repo-assist
難易度 1/5 1〜3時間 初心者へのやさしさ 35/100
fsprojects/FSharp.Control.TaskSeq#476 · コメント 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fsprojects/FSharp.Control.TaskSeq#473 · コメント 1 件 · リアクション 1 件 ·
-
automation enhancement repo-assist
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
enhancement needs triage
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
fsprojects/FSharp.Control.TaskSeq の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
microsoft/magentic-ui#588 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
alexgorbatchev/simple-ptt#3 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
CorrelAid/formtransform#44 ·