does flow and coroutines have anything to do with ...
# flow
b
does flow and coroutines have anything to do with each other? I still confused on these 2 subjects. Thanks.
c
Coroutines are asynchronous functions. Flows are the asynchronous version of
Sequence
from the standard library
g
Complementing @CLOVIS response, with a bit more details: Coroutines are an implementation of continuations, which is a way to construct asynchronous blocks using imperative programming, thus eliminating the need for callbacks. They basically transform the way we write asynchronous code, making it look like synchronous, linear code. Flows, on the other hand, are a construct for building non-blocking reactive streams, powered by coroutines. Reactive streams, which handle data flows and propagation of change, have multiple implementations across different platforms and languages. For instance, Akka Streams are powered by actors, while RxJava uses its own implementation of event loops, for instance. To make it even simpler, consider Flows as asynchronous, lazily evaluated sequences of unknown size, which operate on top coroutines.