Course of Raku / Functional, concurrent, reactive, and web programming / Reactive programming / await / Awaiting a promise
Quiz — await
What does the following program print?
my $p = start { 8 * 8 };
say await $p;| 0 | Promise |
| 0 | 8 |
| 1 | 64 |
| 0 | True |
await waits for the single promise to finish and returns
its result. The block computes 8 * 8, so
await $p is 64.