Contained in: Kotlin Coroutines by Tutorials
async/await
Android & Kotlin
Chapter in Kotlin Coroutines by Tutorials
Async/Await
May 11 2022 · Chapter
Java, you often use Runnable, Callable and Future. With coroutines, you can use Deferred instead. These are objects that you can manage using the async/await functions. In this chapter, you’ll write code to understand when and how to use this pattern most effectively…
Android & Kotlin
Chapter in Kotlin Coroutines by Tutorials
Suspending Functions
May 11 2022 · Chapter
…suspendable functions you’ve seen how suspendable functions utilize Continuations to navigate around and return values as results. The next chapter, “Chapter 5: Async/Await”, relies heavily on the usage of functions which leverage continuations and suspendable functions to return values from code which may or may not be asynchronous…
Android & Kotlin
Chapter in Kotlin Coroutines by Tutorials
Context Switch & Dispatching
May 11 2022 · Chapter
…thread, and have it render. Or better yet, you can run the coroutine on the main thread, bridging to the background, using withContext or async/await, ultimately pulling the result back to the main thread for rendering. Using Dispatchers Now that you know which dispatchers are out there, it’s time…