Overview
Concurrency is one of the most complicated areas in software development. Libraries like RxJava, KotlinX Coroutines, and Arrow provide out of the box solutions for the most common patterns, so developers don't need to scratch their heads every single time to solve their problems. In this course, we will learn how to address the most common concurrency scenarios using pure functional approaches thanks to Arrow.
Prerequisites
- Previous experience with Kotlin.
- IntellIJ IDEA, JDK 8.
What you'll learn
suspend
from Kotlin stdlib, what it represents, how it works.- What does
suspend
translate to at compile time (CPS). - The power of delimited continuations, the mother of all monads.
- Equivalence between wrapped approaches and Kotlin suspend.
- Removing the need for IO wrappers.
suspend
as a mean to track side effects at compile time.- Arrow Fx Coroutines: A pure functional implementation of Kotlin
suspend
system. - Concurrency solved by Arrow Fx Coroutines operators.
- Handling errors in concurrent contexts by leveraging
suspend
+Either
. - Fibers as lightweight threads.
- Fork / Join (as functional async await over fibers).
- Evaluating effects on arbitrary contexts.
- Cancellation across asynchronous boundaries.
- Collaborative cancellation checked by all operators.
- Cancellable effects.
- Error handling in concurrent scenarios.
- Handling concurrent mutable state.
- Parallelization.
- Traversing effects.
- Racing effects.
- Safe resource acquisition with
Bracket
andResource
. - Mutual exclusion and concurrency safety with structures like Semaphore.
- Handling concurrent mutable state with
Atomic
orConcurrentVar
. - Composable repeat and retry strategies with
Schedule
. - Racing fibers.
- Functional implementation of suspend system by Arrow Fx Coroutines. Removing wrappers and promoting
Either
. - Functional Streams
- Functional Streams with embedded effects