Bolero
Bolero copied to clipboard
RunSynchronously hangs
Running this code makes it hang upon return:
JSRuntime.Current.InvokeAsync( "alert", "Hello!") |> Async.AwaitTask |> Async.RunSynchronously
But this works ok:
JSRuntime.Current.InvokeAsync( "alert", "Hello!") |> Async.AwaitTask |> Async.Start
Async.RunSynchronously
doesn't make sense in JS runtimes as it will block the only thread that is running (js is single-threaded)
Maybe, but it should not hang anyway. It should handle it more gracefully specially considering that the code is not targeted for JavaScript but for regular .Net.
Looks like tasks also hang if you try to await them
It depends on the task. Something that depends on user input will definitely hang, because we're running on the UI thread.
Unfortunately this is dependent on upstream changes. Threads need to be implemented in WebAssembly (they're currently experimental in Chrome) and then used by mono-wasm before we can have proper multithreading.
Oh I should clarify. It hangs after responding to the alert message, after closing the dialog. It remains in a loop somewhere in the Wasm code.
Closing as stale.