Skip to content
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

Support multithreaded coroutines for Kotlin/Native in coroutines-interop #304

Closed
arkivanov opened this issue Nov 19, 2019 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@arkivanov
Copy link
Contributor

Currently corotuines-interop is implemented differently for Kotlin/Native, using runBlocking. This is because Job can not be frozen. It has one significant limitation - you can't use coroutines-interop on main thread and subscribeOn is required. Looks like after Kotlin/kotlinx.coroutines#1648 it will be fixed and we will be able to use same implementation as for JVM.

@arkivanov arkivanov self-assigned this Nov 19, 2019
@arkivanov arkivanov changed the title Support multithreaded coroutines for Kotlin/Native Support multithreaded coroutines for Kotlin/Native in coroutines-interop Nov 19, 2019
@arkivanov arkivanov added the enhancement New feature or request label Nov 19, 2019
@arkivanov
Copy link
Contributor Author

arkivanov commented Aug 13, 2020

#314 seems working with mt coroutines version. We could make a separate branch for mt coroutines interop as well, and publish. Perhaps publication of only coroutines-interop module would be enough.

It will lift the runBlocking limitation in native. The interop will be truly async, there will be no requirement to subscribe only on a background scheduler.

Is there a demand?

@CherryPerry JFYI

@nectar1
Copy link

nectar1 commented Aug 13, 2020

Cool news. Lets do separate branch
image

@arkivanov
Copy link
Contributor Author

Multi-threaded coroutines interop is published with -nmtc version suffix. Please see the corresponding Readme section for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants