Posted on Leave a comment

Kotlin coroutines, actors

A first walk into Kotlin coroutines on Android

Kotlin coroutines on Android
[https://developer.android.com/kotlin/coroutines]

Kotlin flows on Android
[https://developer.android.com/kotlin/flow]

Coroutines
[https://kotlinlang.org/docs/coroutines-basics.html]

Android Coroutine Recipes [https://proandroiddev.com/android-coroutine-recipes-33467a4302e9]

Best practices for coroutines in Android
[https://developer.android.com/kotlin/coroutines/coroutines-best-practices]

Concurrent Programming in Kotlin: Coroutines

Simple asynchronous loading with Kotlin Coroutines ; https://hellsoft.se/simple-asynchronous-loading-with-kotlin-coroutines-f26408f97f46; + LifecycleObserver; + Kotlin Coroutine DSL
Coroutines on Android (part I): Getting the background [https://medium.com/androiddevelopers/coroutines-on-android-part-i-getting-the-background-3e0e54d20bb]
Coroutines on Android (part II): Getting started [https://medium.com/androiddevelopers/coroutines-on-android-part-ii-getting-started-3bff117176dd]

Codelab
[https://developer.android.com/codelabs/kotlin-coroutines]
[https://www.raywenderlich.com/2117501-kotlin-coroutines-tutorial-for-android-advanced]
Deep Dive Into Android Lifecycle Coroutines
[https://medium.com/swlh/deep-dive-into-lifecycle-coroutines-e7192312faf]

Coroutines, Yonatan Levin – Android Developer@Monday

Bridging the gap between coroutines, threads, and concurrency problems
03.02.2021 [https://medium.com/androiddevelopers/bridging-the-gap-between-coroutines-jvm-threads-and-concurrency-problems-864e563bd7c]

Synchronization, Thread-Safety and Locking Techniques in Java and Kotlin
02.2019 [https://proandroiddev.com/synchronization-and-thread-safety-techniques-in-java-and-kotlin-f63506370e6d]

Shared flows, broadcast channels
[https://elizarov.medium.com/shared-flows-broadcast-channels-899b675e805c]
[https://habr.com/ru/post/529944/]

Flow under the hood: how does it really work
[https://kt.academy/article/how-flow-works]

How runBlocking May Surprise You
[https://proandroiddev.com/how-to-deadlock-your-android-app-with-runblocking-8dab02c2624d]

Как безболезненно мигрировать с RxJava на Kotlin Coroutines+Flow
[https://habr.com/ru/company/simbirsoft/blog/534706/]

Kotlin Coroutines in Android Summary
[https://medium.com/swlh/kotlin-coroutines-in-android-summary-1ed3048f11c3]

Misnomers, Mistakes and Misunderstandings to watch for when learning Kotlin Coroutines and Flow
[https://medium.com/google-developer-experts/misnomers-mistakes-and-misunderstandings-to-watch-for-when-learning-kotlin-coroutines-and-flow-2744186be3e]

StateFlow with One- and TwoWay-DataBinding on Android
[https://proandroiddev.com/stateflow-with-one-and-twoway-databinding-on-android-cf4e6c847988]

The Best Way to Collect a Flow in Kotlin – launchIn
[https://handstandsam.com/2021/02/19/the-best-way-to-collect-a-flow-in-kotlin-launchin]

Using Flows for Form Validation in Android.
[https://levelup.gitconnected.com/using-flows-for-form-validation-in-android-79016b00c079]

Backpressure in your Kotlin Flows
[https://medium.com/google-developer-experts/backpressure-in-your-kotlin-flows-3eec980869c7]

7 Gotchas When Explore Kotlin Coroutine
[https://medium.com/mobile-app-development-publication/7-gotchas-when-explore-kotlin-coroutine-64b78f005150]

Корутины и синхронизация. Лучше не смешивать
[https://habr.com/ru/company/funcorp/blog/528778/]

Coroutines: First things first. Cancellation and Exceptions in Coroutines (Part 1)
[https://medium.com/androiddevelopers/coroutines-first-things-first-e6187bf3bb21]

Cancellation in coroutines
[https://medium.com/androiddevelopers/cancellation-in-coroutines-aa6b90163629]

Отменяем операции правильно на примере корутин
[https://habr.com/ru/company/deliveryclub/blog/663392/]

Exceptions in Coroutines
[https://medium.com/androiddevelopers/exceptions-in-coroutines-ce8da1ec060c]

Are you handling exceptions in Kotlin coroutines properly?
[https://www.netguru.com/codestories/exceptions-in-kotlin-coroutines]
[https://habr.com/ru/post/664444/]

Coroutines & Patterns for work that shouldn’t be cancelled
Cancellation and Exceptions in Coroutines (Part 4)
[https://medium.com/androiddevelopers/coroutines-patterns-for-work-that-shouldnt-be-cancelled-e26c40f142ad]

Using Kotlin Coroutines in your Android App [https://codelabs.developers.google.com/codelabs/kotlin-coroutines/]

Use Kotlin coroutines with Architecture components [https://developer.android.com/topic/libraries/architecture/coroutines]

From RxJava to Kotlin Flow: Error Handling
[https://proandroiddev.com/from-rxjava-to-kotlin-flow-error-handling-da1f6a4f2708]
From RxJava to Kotlin Flow: Backpressure [ https://proandroiddev.com/from-rxjava-to-kotlin-flow-backpressure-d1fb91e6dea8 ]
From RxJava to Kotlin Flow: Testing
[https://proandroiddev.com/from-rxjava-to-kotlin-flow-testing-42f1641d8433]
The Real Kotlin Flow benefits over RxJava
[https://proandroiddev.com/the-real-kotlin-flow-benefits-over-rxjava-c19b99ba6eb9]

StateFlow, SharedFlow
Introduce StateFlow
[https://github.com/Kotlin/kotlinx.coroutines/issues/1973]
Пробуем и разбираемся с StateFlow
[https://habr.com/ru/post/501308/]
StateFlow, End of LiveData?
[https://medium.com/scalereal/stateflow-end-of-livedata-a473094229b3]
Replace SingleLiveEvent with kotlin Channel / Flow
[https://cesarmorigaki.medium.com/replace-singleliveevent-with-kotlin-channel-flow-b983f095a47a]
kotlinx.coroutines 1.4.0: Introducing StateFlow and SharedFlow
[https://blog.jetbrains.com/kotlin/2020/10/kotlinx-coroutines-1-4-0-introducing-stateflow-and-sharedflow/]

A safer way to collect flows from Android UIs
24.03.2021 by Manuel Vivo [https://medium.com/androiddevelopers/a-safer-way-to-collect-flows-from-android-uis-23080b1f8bda]
[https://t.me/android_live/623]

Kotlin flows on Android
[https://developer.android.com/kotlin/flow]

Even smarter async with coroutine actors ; https://hellsoft.se/even-smarter-async-with-coroutine-actors-6d35d8f5c8f3; + Channels; + Sequence of events; + Actor

Kotlin Coroutines — Handling concurrency like a pro (Retrofit2 + Coroutines) [https://proandroiddev.com/kotlin-coroutines-handling-concurrency-like-a-pro-retrofit2-coroutines-31cd0611fd91]

Coroutines and RxJava — An Asynchronicity Comparison [https://medium.com/@manuelvicnt/coroutines-and-rxjava-an-asynchronicity-comparison-part-5-operators-2603a8ecaa5f]

[https://habr.com/company/alfa/blog/336228/] Kotlin coroutines guide – concurrent programming in kotlin [https://kotlinexpertise.com/kotlin-coroutines-guide/]

[https://nuancesprog.ru/p/2149/]

Room + Coroutines [https://medium.com/androiddevelopers/room-coroutines-422b786dc4c5]

Kotlin coroutines, threads, concurrency and parallelism 101 [https://android.jlelse.eu/kotlin-coroutines-threads-concurrency-and-parallelism-101-78a56e09d373]

Threading models in Coroutines and Android SQLite API [https://medium.com/androiddevelopers/threading-models-in-coroutines-and-android-sqlite-api-6cab11f7eb90]

Watcha Doin’? Inspecting Kotlin coroutines with timing graphs. [https://proandroiddev.com/watcha-doin-inspecting-kotlin-coroutines-with-timing-graphs-1676132d940f]

Exceptions and proxies and coroutines, oh my! [https://jakewharton.com/exceptions-and-proxies-and-coroutines-oh-my/]

Kotlin Coroutines для Android — Прощай RxJava? [https://nuancesprog.ru/p/2149/]

Corbind – Coroutines binding APIs for Android UI widgets from the platform and support libraries. [https://ldralighieri.github.io/Corbind/]

Coroutines in Kotlin 1.3 explained: Suspending functions, contexts, builders and scopes [https://antonioleiva.com/kotlin-coroutines/]

How can we use CoroutineScopes in Kotlin? [https://medium.com/swlh/how-can-we-use-coroutinescopes-in-kotlin-2210695f0e89]

Making Android unidirectional data flow with Kotlin coroutines [https://blog.kotlin-academy.com/making-android-unidirectional-data-flow-with-kotlin-coroutines-d69966717b6e]

Structured Concurrency Anniversary [https://medium.com/@elizarov/structured-concurrency-anniversary-f2cc748b2401]

How to unit test code with Coroutines [https://proandroiddev.com/how-to-unit-test-code-with-coroutines-50c1640f6bef]

Kotlin: when statement, when expression… oh my! or How we created our custom Detekt rule [https://proandroiddev.com/kotlin-when-statement-when-expression-oh-my-or-how-we-created-our-custom-detekt-rule-6f27e80bedaf]

RxJava VS. Coroutines In Two Use Cases [https://medium.com/swlh/rxjava-vs-coroutines-in-two-use-cases-71925479cb85]

Unit Testing Coroutine Suspend Functions using TestCoroutineDispatcher [https://craigrussell.io/2019/11/unit-testing-coroutine-suspend-functions-using-testcoroutinedispatcher/]

Everything you need to know about kotlin coroutines [https://medium.com/swlh/everything-you-need-to-know-about-kotlin-coroutines-b3d94f2bc982]

Testing two consecutive LiveData emissions in Coroutines [https://medium.com/androiddevelopers/testing-two-consecutive-livedata-emissions-in-coroutines-5680b693cbf8]


«Coroutines Flow», Кирилл Розов, Epam

https://www.youtube.com/watch?v=0ioDlsVyw1g

To modify data RxJava provides a lot of methods, but Kotlin Coroutines doesn’t have them. This library’s goal is creating functions that will provide users possibility to use the same functional as in RxJava
[ https://github.com/epam/CoroutinesExtensions ]

The suspend modifier — Under the hood
24/03/2020 by Manuel Vivo [https://medium.com/androiddevelopers/the-suspend-modifier-under-the-hood-b7ce46af624f]

Kotlin Coroutines in Android — Channel [ https://medium.com/swlh/kotlin-coroutines-in-android-channel-fb9b3b65e0b ]

Binding Android UI with Kotlin Flow [ https://dev.to/ychescale9/binding-android-ui-with-kotlin-flow-22ok ]


Preventing coroutine cancellation for important actions [ https://craigrussell.io/2020/03/preventing-coroutine-cancellation-for-important-actions/ ]
NonCancellable [ https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-non-cancellable.html ]

Coroutines and exceptions: things to know
[https://www.rockandnull.com/coroutines-and-exceptions/]

Understanding Kotlin Coroutines with this mental model
[https://www.lukaslechner.com/understanding-kotlin-coroutines-with-this-mental-model/]
Do I need to call suspend functions of Retrofit and Room on a background thread?
[https://proandroiddev.com/do-i-need-to-call-suspend-functions-of-retrofit-and-room-on-a-background-thread-26650dac762d]

Coroutines: Suspending State Machines
[https://medium.com/google-developer-experts/coroutines-suspending-state-machines-36b189f8aa60]

Deep recursion with coroutines
[https://medium.com/@elizarov/deep-recursion-with-coroutines-7c53e15993e3]

Phantom of the Coroutine
[https://medium.com/@elizarov/phantom-of-the-coroutine-afc63b03a131]

Корутины: основы
[https://nuancesprog.ru/p/7397/]
Корутины: исключения
[https://nuancesprog.ru/p/7604/]

[https://maxkim.eu/things-every-kotlin-developer-should-know-about-coroutines-part-1-coroutinecontext]
[https://maxkim.eu/things-every-kotlin-developer-should-know-about-coroutines-part-2-coroutinescope]
[https://maxkim.eu/things-every-kotlin-developer-should-know-about-coroutines-part-3-structured-concurrency]
[https://maxkim.eu/things-every-kotlin-developer-should-know-about-coroutines-part-4-exception-handling]
[https://maxkim.eu/things-every-kotlin-developer-should-know-about-coroutines-part-5-cancellation]

FlowExt library
[https://github.com/hoc081098/FlowExt]

Actor

Kotlin Concurrency with Actors
[https://medium.com/@jagsaund/kotlin-concurrency-with-actors-34bd12531182]

Is there a way to reuse a Job instance?
[https://stackoverflow.com/questions/42829575/is-there-a-way-to-reuse-a-job-instance]
[http://www.arvifox.com/android-is-there-a-way-to-reuse-a-job-instance_-stack-overflow/]


Structured concurrency with two parent jobs
[https://github.com/Kotlin/kotlinx.coroutines/issues/1001]


Testing

A small testing library for kotlinx.coroutines Flow
[https://github.com/cashapp/turbine] by Jake Wharton

How We Test Concurrent Primitives in Kotlin Coroutines
[https://blog.jetbrains.com/kotlin/2021/02/how-we-test-concurrent-primitives-in-kotlin-coroutines/]
[https://github.com/Kotlin/kotlinx-lincheck]

A deep dive into the subtleties of testing Kotlin coroutines
07.2022 [https://www.droidcon.com/2022/07/01/testdispatcher-become-the-clock-master/]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.