This blogpost is a continuation of the previous post: Coroutines Flow, and goes deeper into coroutine streams. In this article, I’m going to explore hot streams called Channel. What is it? What does it do? How does it work? How to create and handle it? How does it compare with the cold streams? And finally, is there a place for both hot and cold streams? Let’s find out!
Transferring a single value between coroutines can be done by the Deferred object (the result of async job). But when you need to transfer a stream of values between multiple coroutines, there…
This blogpost is a continuation of the previous post: Coroutines Basics, and covers more advanced mechanisms than basic coroutines have to offer. In this article, I’m going to present an idea of coroutine streams called Flow. Why and when do we need it? What can be achieved by using it? How to create and manage it? And how does it affect and cooperate with coroutines? I hope you will find all the answers below.
As far as we already know from the previous article, a suspending function can return a single value. What if there is a need to return…
We developers are constantly on a lookout for new solutions, the best approaches so no wonder the world is changing and asynchronous programming is changing with it. At Fandom we do the same: we want to follow and apply the best solutions for specific problems. And that’s what we did for one of our latest projects. We decided to use Kotlin Coroutines in our Android app, not only because they are native (less dependencies, loosely coupled) but especially their usage has certain benefits.
It doesn’t matter if you write mobile or desktop or even server-side applications, there could be a…