# Elixir Level 6: Tasks & Agents

> Level 6: Tasks & Agents of the LoWisa Elixir course: Tasks, Agents, Managing Concurrent Work. 3 lessons and 9 ideas, each explained in one line.

Tasks & Agents is level 6 of 16 of the [LoWisa Elixir course](/courses/elixir/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Tasks

- **Task.async.** **Task.async** runs a function concurrently: await joining the result with a timeout.
- **Task.async_stream.** **async_stream** maps a collection concurrently with bounded workers: fan-out with backpressure built in.
- **Supervised tasks.** Production tasks start under a **Task.Supervisor**: crashes contained, shutdown clean.

## Agents

- **Agents.** An **Agent** wraps state in a process: get and update through simple functions.
- **When agents fit.** Agents suit **simple** shared state: counters, caches: anything smarter deserves a GenServer.
- **Bottleneck awareness.** One agent serialises access: a hot agent is a **bottleneck** measured, then redesigned.

## Managing Concurrent Work

- **Fan-out patterns.** Fan out with tasks, join with **await**: partial failures handled per task, not ignored.
- **Timeout discipline.** Every await carries a **timeout**: and a decision about what its expiry means.
- **Ownership of results.** Concurrent design names one **owner** per piece of state: everyone else asks politely.

## Before and after this level

- **Before:** [Level 5: Processes](/courses/elixir/level-5-processes/): Processes, Messages, Links and Monitors.
- **Next:** [Level 7: GenServer](/courses/elixir/level-7-genserver/): Stateful Processes, Calls and Casts, Designing Reliable Servers.

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](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Elixir Level 6: Tasks & Agents cover?

Tasks, Agents, Managing Concurrent Work: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 5: Processes, which covers Processes, Messages, Links and Monitors.

## Learn Elixir on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/elixir/level-6-tasks-and-agents/ · Updated 2026-11-25
