File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
=SUBTITLE Status/result of an asynchronous computation
6
6
7
- my enum PromiseStatus (:Planned(0), :Kept(1), :Broken(2));
8
7
class Promise {}
9
8
10
9
A C<Promise> is used to handle the result of a computation that might not have
@@ -291,8 +290,9 @@ C<Planned>.
291
290
method status(Promise:D --> PromiseStatus)
292
291
293
292
Returns the current state of the promise: C<Kept>, C<Broken> or C<Planned>:
293
+ See L<C<PromiseStatus>|/type/PromiseStatus>.
294
294
295
- =for code :skip-test<compile time error >
295
+ =for code :preamble<my $promise >
296
296
say "promise got Kept" if $promise.status ~~ Kept;
297
297
298
298
=head2 method scheduler
Original file line number Diff line number Diff line change
1
+ =begin pod :kind("Type") :subkind("enum") :category("basic")
2
+
3
+ =TITLE enum PromiseStatus
4
+
5
+ =SUBTITLE Indicate status of a promise
6
+
7
+ enum PromiseStatus <Planned Kept Broken>;
8
+
9
+ X<|Reference,Planned>
10
+ X<|Reference,Kept>
11
+ X<|Reference,Broken>
12
+ An enum for indicating the result of a L<C<Promise>|/type/Promise>.
13
+ Consists of C<Planned>, C<Kept> and C<Broken>.
14
+
15
+ =end pod
You can’t perform that action at this time.
0 commit comments