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

[Bug] Online playground is not working when use Executors.newSingleThreadExecutor().asCoroutineDispatcher() as CorotuineDisaptcher #158

Open
kkkkan opened this issue Apr 21, 2022 · 0 comments

Comments

@kkkkan
Copy link

kkkkan commented Apr 21, 2022

When Executors.newSingleThreadExecutor().asCoroutineDispatcher() is used as CorotuineDisaptcher in Kolin online playground , hardly success . ( But very occasionally successful.)
I encounted Evaluation stopped while it's taking too long️ error message.

image

code run

Code is following

import kotlinx.coroutines.*
import java.util.concurrent.Executors

fun main(){
    val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher()
    val scope = CoroutineScope(Job()+dispatcher)
    scope.launch {
        println("1")
    }

    println("2")
}

I tried

  • Kotlin version v1.4.30 / v1.5.31 / v1.6.21
  • with all for JVM

but get same result.

As a side note

When I Executors.newSingleThreadExecutor().asCoroutineDispatcher() replace with newSingleThreadContext(name: String) and run , always get success and following result message : 1 2.

Execution Environment :

  • PC :
    Edition Windows 10 Home
    Version 21H2
    Install on ‎2022/‎01/‎04
    OS build 19044.1645
    Experience Windows Feature Experience Pack 120.2212.4170.0

  • Browser :
    Google Chrome version : 100.0.4896.127(Official Build) (64 bit)

(・ Country : Japan)

Thank you.

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

No branches or pull requests

1 participant