Futures
- Future. A Future runs work asynchronously and completes with a value or failure.
- Composing futures. Futures compose with map and for-comprehensions: parallel starts, sequential description.
- ExecutionContext. Futures run on an ExecutionContext: the pool you choose, not an invisible default.
Concurrent Programming
- Immutability pays. Immutable data crosses threads safely: most Scala concurrency bugs die at the design stage.
- Promises. A Promise completes a Future by hand: the bridge from callback APIs.
- Blocking honestly. Blocking calls are marked and isolated: a starved pool is the classic Future outage.
Functional Concurrency Patterns
- Structured concurrency. Effect libraries offer fibers: cheap, cancellable, supervised: structured concurrency in Scala.
- Parallel combinators. parTraverse and friends run a collection’s work in parallel: bounded, composed, typed.
- Cancellation as design. Functional runtimes make cancellation safe: resources released by bracket, not luck.
Before and after this level
- Before: Level 8: Errors & Effects: Option and Either, Effectful Computation Concepts, Reliable Functional Error Handling.
- Next: Level 10: JVM Interoperability: Java Interop, Runtime Behaviour, Mixed JVM Systems.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Scala Level 9: Concurrency cover?
Futures, Concurrent Programming, Functional Concurrency Patterns: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 8: Errors & Effects, which covers Option and Either, Effectful Computation Concepts, Reliable Functional Error Handling.