Course of Raku / Functional, concurrent, reactive, and web programming / Concurrent programming / Promises / Exercises / Kept or broken
Solution: Kept or broken
Here is a possible solution to the task.
Code
my $p = start { 10 };
await $p;
say $p.status;🦋 You can find the source code in the file kept-or-broken.raku.
Output
KeptComments
After the block finishes successfully, the promise is kept.
.statusreports this asKept. Had the block thrown an exception, the status would beBrokeninstead.
Course navigation
← Kept or broken | Channels →