FSharp.Control.AsyncSeq icon indicating copy to clipboard operation
FSharp.Control.AsyncSeq copied to clipboard

AsyncSeq deadlocks in Blazor WASM environment

Open ordinaryorange opened this issue 3 years ago • 2 comments

Description

When calling AsyncSeq.ofAsyncEnum the thread becomes deadlocked and the app grinds to a halt

Please provide the steps required to reproduce the problem

Following code called from an async method in a Blazor WASM app (eg OnInitializedAsync())

    printfn "Starting length print"

    let! len = AsyncSeq.init 10 id |> AsyncSeq.toAsyncEnum |> AsyncSeq.ofAsyncEnum |> AsyncSeq.length

    printfn "Length is:%i" len

Expected behavior

Don't eat my thread, it is the only one I have

Known workarounds

Grabbing the AsyncEnumerator and iterating over that..ugh

ordinaryorange avatar Mar 30 '22 12:03 ordinaryorange

Interesting, apparently you are writing a function in f# and calling it in blazor, can I please see the function in f#

Xyncgas avatar Sep 15 '22 02:09 Xyncgas

Here is a repo Run the app and index page will deadlock

ordinaryorange avatar Sep 17 '22 00:09 ordinaryorange