https://kotlinlang.org logo
#coroutines
Title
# coroutines
b

Big Chungus

12/27/2019, 12:30 PM
How do I execute a blocking piece of code in common module with coroutines? In JVM there's
runBlocking {...}
, but I cannot find anything simmilar on common module.
m

Mikołaj Kąkol

12/27/2019, 12:36 PM
We use actual/expect for that. Also we use it only for tests.
d

Dico

12/27/2019, 12:45 PM
runBlocking
is only defined on the jvm and native platforms. On JS, there is only one thread, hence it does not exist. You can define common stubs delegating to the platform specific functions
r

Robert Jaros

12/27/2019, 1:26 PM
2 Views