Hi guys, anyone help me what the difference betwee...
# coroutines
t
Hi guys, anyone help me what the difference between suspendCoroutine and suspendCancellableCoroutine?
f
suspendCoroutine is the primitive baked in the language (kotlin.coroutines). suspendCancellableCoroutine is the primitive offered by the coroutines library kotlinx.coroutines, which interoperates with the rest (job, dispatchers, ...) to support prompt cancellation. If you want to write a component to be used with the kotlinx library (most likely the case), use the cancellable version.