Suspending lambdas are just anonymous suspending functions and follow the same convention as the later. The exceptions to this rule are withContext and various coroutine builders like launch, that is all the functions that take CoroutineContext as their parameter, allowing to explicitly specify dispatcher to move blocking code out of the main/critical threads.

Written by

Project Lead for the Kotlin Programming Language @JetBrains

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store