-
-
Notifications
You must be signed in to change notification settings - Fork 572
Add IORuntime#dispatcher? #1791
Copy link
Copy link
Closed
Labels
Description
I encountered this while upgrading a ScalaJS application: there's no default way to start a fiber and get it synchronously, which might sometimes be desirable (e.g. aforementioned JS land, as well as tests in frameworks like scalatest).
For this reason, I would've suggested adding a .startSync method on IO (cross-compiled, because why not), but prompted by @vasilmkd's mention of Dispatcher thought it would be even nicer to have a global Dispatcher that works directly with IORuntime - the right place to put it would likely be IORuntime itself, as it already has a dependency on std.
This would allow direct usage of unsafeToFutureCancelable / unsafeRunCancelable without IO/Resource.
Reactions are currently unavailable