Course of Raku / Functional, concurrent, reactive, and web programming / Reactive programming

await

Concurrent and reactive code launches work that finishes later. At some point you need to wait for that work and use its result. The tool for this is await.

You have already met await with promises. This section gathers the idea together: how await waits for one or many promises, and how reactive constructs like react provide the same “wait until done” guarantee for streams.

Topics in this section

Practice

Complete the quiz that covers the contents of this section.

Exercises

This section contains 3 exercises. Examine all the topics of this section before doing the coding practice.

  1. Await a promise
  2. Await a supply
  3. Await a failure

Course navigation

Solution: Two whenevers   |   Awaiting a promise