Hey guys what is the difference between of runblocking and suspend function in KMM ?
b
Big Chungus
04/27/2022, 10:21 PM
Runblocking blocks a current thread until all the work inside the lambda completes. Suspending function does not block the thread and can reuse a single thread to resolve multiple suspending functions concurrently
Big Chungus
04/27/2022, 10:22 PM
runblocking should only be ever used to enter the coroutine scope and even then there usually are better ways to do it.