how do you create a coroutine scope for the main t...
# coroutines
b
how do you create a coroutine scope for the main thread when you're not using Android? there's no Dispatchers.Main
it's just the jvm
s
IIRC, you'd need a thread that is part of a pool tied to a queue on which Coroutines are scheduled (in Android that would be called a Looper). A plain main JVM thread does not meet that requirement.
l
If you use JavaFx or Java Swing, there's ui integrations for it. Otherwise, you just use
runBlocking { ... }
in the main function.