kotlin coroutines, what is the difference between coroutineScope and withContext

Formally, coroutineScope is a special case of withContext where you pass in the current context, avoiding any context switching. Schematically speaking, coroutineScope ≡ withContext(this.coroutineContext) Since switching contexts is just one of several features of withContext, this is a legitimate use case. withContext waits for all the coroutines you start within the block to complete. If … Read more