-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dispatchers.IO
not available on Kotlin/Native
#3205
Comments
What is the best dispatcher to use for blocking IO operations on Kotlin/Native until this issue is resolved? |
@jakobkmar |
Is there a way to create some sort of IO dispatcher with no thread switching from Dispatchers.Default? An IO dispatcher would be very helpful to me. |
@qwwdfsad wouldn't |
@saket we don't want |
@dkhalanskyjb is your concern valid for both native and JVM platforms? I was only suggesting using |
Sure, I don't see any difference in this regard. |
It's been almost a year since this issue was opened. Is there any update on this? |
* Emulate expect declaration refinement via extension property as the only way to do it in a backwards-compatible manner: in the current model it is impossible to have common 'expect' Dispatchers declaration, then refined 'concurrent' Dispatchers declaration with 'expect val IO' and then JVM declaration with JVM-specific members. Current solutions seems to be the less intrusive one * Elasticity is not supported as K/N Workers API lacks capability to gracefully shutdown workers, meaning that for any unlimited underlying pool, memory consumption is only going to grow in an unbound manner Fixes #3205
* Emulate expect declaration refinement via extension property as the only way to do it in a backwards-compatible manner: in the current model it is impossible to have common 'expect' Dispatchers declaration, then refined 'concurrent' Dispatchers declaration with 'expect val IO' and then JVM declaration with JVM-specific members. Current solutions seems to be the less intrusive one * Elasticity is not supported as K/N Workers API lacks capability to gracefully shutdown workers, meaning that for any unlimited underlying pool, memory consumption is only going to grow in an unbound manner Fixes #3205
Hi Hi 👋 Flavio here I've created an
And the implementation for the iOS module is:
However, I'm not pretty sure that the
Shouldn't we have something similar for iOS? Limiting the |
* Emulate expect declaration refinement via extension property as the only way to do it in a backwards-compatible manner: in the current model it is impossible to have common 'expect' Dispatchers declaration, then refined 'concurrent' Dispatchers declaration with 'expect val IO' and then JVM declaration with JVM-specific members. Current solutions seems to be the less intrusive one * Elasticity is not supported as K/N Workers API lacks capability to gracefully shutdown workers, meaning that for any unlimited underlying pool, memory consumption is only going to grow in an unbound manner Fixes #3205
Wondering, is it now available? The doc looks outdated? https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/-i-o.html |
@arkivanov yeah, it's an extension function that shadows the JVM field, documented here: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-i-o.html |
Dispatchers.IO
is only available for Kotlin/JVM according to the docs.It would be great to have this available on Kotlin/Native, as this would make it easier to share code between JVM and native environments.
(from https://youtrack.jetbrains.com/issue/KT-51449)
The text was updated successfully, but these errors were encountered: