The task builder in FSharpx.Extras is obsolete and should be marked as Obsolete with a comment that points users in the right direction.
Previous text:
Description
How are you supposed to use TaskBuilder with Task, i.e. not Task<unit> ?
Repro steps
Expected behavior
member this.Batch cs= task {
use fs = File.Open(fileName, FileMode.Append, FileAccess.Write, FileShare.Read)
use w = new StreamWriter(fs)
w.WriteLine(serialize(cs |> List.toArray))
do! fs.FlushAsync()
}
Actual behavior
I'd expect it task computation builder to work with Task but it seems I need to do:
member this.Batch cs= task {
use fs = File.Open(fileName, FileMode.Append, FileAccess.Write, FileShare.Read)
use w = new StreamWriter(fs)
w.WriteLine(serialize(cs |> List.toArray))
do! fs.FlushAsync().ContinueWith<unit>( fun _ -> () )
}
The task builder in FSharpx.Extras is obsolete and should be marked as Obsolete with a comment that points users in the right direction.
Previous text: