Convert Callback Into Kotlin Coroutines Suspend or Deferred
Convert Callback Into Kotlin Coroutines Suspend or Deferred
Since coroutine is a hot topic in mobile development, converting vanilla JVM callback into Kotlin Coroutines is desirable. The wrapping happens using something called SuspendCoroutine. What is a SuspendCoroutine suspendCoroutine is a builder function that mainly used to convert callbacks into suspend functions. Let’s say for example you have some legacy (or not) Api, that uses callbacks. You…
View On WordPress










