Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[6.d] Update output examples for sunk start
  • Loading branch information
zoffixznet committed Nov 2, 2018
1 parent 24e1691 commit ec633ca
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions doc/Type/Promise.pod6
Expand Up @@ -81,8 +81,10 @@ thrown without any C<start> statement prefixes involved.
=begin code
use v6.d.PREVIEW;
start { die }; sleep ⅓; say "hello";
# OUTPUT: Died
# in block at -e line 1
# OUTPUT:
# Unhandled exception in code scheduled on thread 4
# Died
# in block at -e line 1
=end code
If you wish to avoid this behaviour, use C<start> in non-sink context or
Expand All @@ -99,9 +101,10 @@ catch the exception yourself:
# OUTPUT: «caught␤hello␤»
=end code
This behaviour exists only syntaxically and not as part of method L<sink>
on L<Promise> object, thus sinking a L<Promise> object or having a C<start>
block as return value of a routine won't trigger this behaviour.
This behaviour exists only syntaxically, by using an alternate C<.sink> method
for L<Promise> objects created by C<start> blocks in sink context, thus simply
sinking a L<Promise> object that was created by other means won't trigger this
behaviour.
=head2 method in
Expand Down

0 comments on commit ec633ca

Please sign in to comment.