Kotlin Flows Producer-Consumer Design Pattern Implementation

Photo by John Tuesday on Unsplash

In this post, I would like to demonstrate a basic producer - consumer model that uses Kotlin Flows (consumer is faster than producer).

Let’s image our example app downloads the stock-exchange or currency rates every 1 second, display them on the RecyclerView and provides us to change the calculation value on the fly.




Yet another Ameloper https://github.com/ibrahimyilmaz

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why Kotlin for Android development

Building a Simple Photo App with Jetpack Compose, CameraX, and coroutines part 2: Camera Preview

Wireless debugging for an Android, Flutter or React Native Developers

Implementing an Active Network-State Monitor in Android

Android Stack Weekly — Issue #12

AlertDialog and CustomDialog in Android With Kotlin.

Getting Started with Jetpack Compose

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ibrahim Yilmaz

Ibrahim Yilmaz

Yet another Ameloper https://github.com/ibrahimyilmaz

More from Medium

DynamoDB Gotchas

Design Patterns in Kotlin: Visitor

How we handle query parameter breaking changes in Whoz API

Mastering refactoring