David Glasser
11/07/2019, 7:59 PMfun main() = runBlocking {
We just discovered that this leads to coroutines being run single-threaded by default, not in Dispatchers.Default. This is a big surprise! Is the normal pattern supposed to be fun main() = runBlocking(Dispatchers.Default) {
?suspend fun main()
now?octylFractal
11/07/2019, 8:00 PMrunBlocking
is an event loop that runs on the thread that called it. suspend fun main()
is just shorthand for using runBlocking
iircDavid Glasser
11/07/2019, 8:01 PMfun main = runBlocking(Dispatchers.Default)
?octylFractal
11/07/2019, 8:01 PMCoroutineScope
that I `launch`/etc. off ofDavid Glasser
11/07/2019, 8:02 PMmarstran
11/07/2019, 8:13 PMsuspend fun main() = coroutineScope { ... }
Ran Magen
11/08/2019, 10:04 PMError: Main method not found in class Temp, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
octylFractal
11/08/2019, 10:25 PMmain()
inside a class Temp { }
declaration? if not, TempKt
is the correct class nameRan Magen
11/15/2019, 10:21 PMsuspend fun main(args: Array<String>) = coroutineScope { .. }
should work as a main function?octylFractal
11/15/2019, 10:34 PM