Workshop Icon
WORKSHOPS

Fearless concurrency with cats-effect IO

Streams, Scala, Concurrency

Max. Attendees: 12

What attendees will learn

Concurrent systems are vital, but are notoriously difficult to design. Without proper safeguards, it's all too easy to introduce bugs, race conditions, resource leakage and deadlocks.

In this workshop, you'll learn how cats-effect IO can be used to design reliable, bug-free, testable concurrent systems.

We explore different techniques of describing concurrent processes, such as structured concurrency and supervision, and see how these can be coded using cats-effect.

We'll run through a brief history of concurrency in Linux and the JVM, and see how this influences the cats-effect IO API. In particular, we look at the difference between blocking and non-blocking IO, learn when each should be used, and how they integrate with other async processes.

Finally, we'll learn how to write fast tests for time-based processes using the cats-effect test runtime. By the end, you'll have a solid grasp of cats-effect and the confidence to design reliable concurrent systems to suit your own needs.

Target audience

This workshop is aimed at developers of all experiences and backgrounds who are curious about concurrent systems, threads, and how to manage them reliably. You'll particularly benefit from this if you need to choose a runtime, such as cats-effect, or ox, and want to understand their differences.

Length

This is a half-day workshop, from 9AM - 2PM.

Agenda

What is concurrency?
  • Concurrency vs parallelism
  • Challenges of concurrent processes: non-determinism, cancellation, error propagation
  • Identifying concurrency bugs
Structured concurrency
  • What is structured concurrency?
  • Intro to cats-effect IO and concurrent processes
  • Managing fibres vs managing threads
  • Managing background processes with Resource
  • Managing background processes with Supervisor
Interfacing with other async processes
  • Linux & JVM concurrency: threads, virtual threads and their consequences
  • Managing blocking IO with cats-effect
  • Integrating with the Scala Future
  • Integrating with callback APIs
Testing concurrent processes
  • The challenges of testing non-deterministic systems
  • Mocking time with the cats-effect testkit
Prerequisites

A knowledge of basic Scala syntax (either Scala 2 or 3). You don't need any functional programming experience, or any familiarity with cats-effect.

Requirements

You'll need a laptop with an IDE setup for basic Scala projects.

Companies using the tech

Apple, Disney, ITV, BBC, Xebia, SiriusXM, Jack Henry, JP Morgan, William Hill, and many more.

Crema Workshop

€199