Skip to content

Commit cc4fa61

Browse files
authored
Merge pull request #229 from fsprojects/repo-assist/fix-ofasyncsenum-dispose-wasm-deadlock-issue152-0a3ae3e9fadf4869
[Repo Assist] Fix ofAsyncEnum deadlock on single-threaded runtimes (Blazor WASM)
2 parents e6b2ae3 + fbf3b1d commit cc4fa61

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/FSharp.Control.AsyncSeq/AsyncSeq.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,9 @@ module AsyncSeq =
19061906
use _ =
19071907
{ new IDisposable with
19081908
member __.Dispose() =
1909-
e.DisposeAsync().AsTask() |> Async.AwaitTask |> Async.RunSynchronously }
1909+
// Fire-and-forget: avoids Async.RunSynchronously which deadlocks
1910+
// on single-threaded runtimes such as Blazor WASM (see issue #152).
1911+
e.DisposeAsync() |> ignore }
19101912

19111913
let mutable currentResult = true
19121914
while currentResult do

0 commit comments

Comments
 (0)