Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convenience methods for constructing a custom IORuntime #2638

etspaceman started this conversation in Ideas
Convenience methods for constructing a custom IORuntime #2638
Dec 9, 2021 * 0 comments
Return to top
Discussion options

etspaceman
Dec 9, 2021

I recently had the need to manually construct an IORuntime, which took in an Executor and used it as its compute pool. Doing this was... not the most intuitive thing in the world.

def executorRuntime(EC: ExecutionContext): IORuntime {
override val runtime: IORuntime = {
val (blocking, _) = IORuntime.createDefaultBlockingExecutionContext()
val (scheduler, _) = IORuntime.createDefaultScheduler()

IORuntime(EC, blocking, scheduler, () => (), IORuntimeConfig())
}
}

It would be interesting to have some of these convenience methods in cats effect. Or, at the very least, some documentation on doing these things.

I opened this as a discussion per a conversation with @djspiewak, as we may not want to encourage these operations (since the default IORuntime has a lot of benefits).

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant