Skip to content

Mark TaskBuilder as Obsolete and point to TaskBuilder.fs #368

Description

@wallymathieu

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 _ -> () )
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions