fsprojects / FSharp.Control.AsyncSeq

Asynchronous sequences for F#
https://fsprojects.github.io/FSharp.Control.AsyncSeq/
Other
161 stars 59 forks source link

TaskSeq? #150

Open BrianVallelunga opened 2 years ago

BrianVallelunga commented 2 years ago

Is there a plan to add an equivalent taskSeq CE to this library? Thanks

dsyme commented 2 years ago

We will be making a new version of this library that implements the official task-producing IAsyncEnumerable.

Indeed I'll be working on that now

BrianVallelunga commented 2 years ago

Thanks for the news. That's great to hear.

bigjonroberts commented 2 years ago

Was just looking for this today. Any updates? I'm able to convert to AsyncSeq for this use-case, but would love to see TaskSeq available for my other use-cases.

abelbraaksma commented 2 years ago

For reference, there's code in F# right now that has the taskSeq, used for perf testing. It was written by @dsyme I believe, but currently misses the dynamic parts: https://github.com/dotnet/fsharp/blob/d5312aae8aad650f0043f055bb14c3aa8117e12e/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/taskSeq.fs.

My guess it, this would be a good starting point for implementing this.

abelbraaksma commented 1 year ago

@BrianVallelunga and others monitoring this, it's taken a bit of time, but I picked up the gauntlet and recently finished a decent MVP for this, after ironing out a few bugs in the resumable state machine code (there are PRs that document this in case you're curious).

Just today I moved it to FsProjects with help by @dsyme, you can find it here: https://github.com/fsprojects/FSharp.Control.TaskSeq (edited, was wrong link).

It is available as NuGet pack and under active development by the community.

BrianVallelunga commented 1 year ago

Great to hear. Thanks!