Skip to content

Add IORuntime#dispatcher? #1791

@kubukoz

Description

@kubukoz

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions