Created
April 6, 2017 18:49
-
-
Save anonymous/3fc0820fc8b7612ba42e7cc03ff446ee to your computer and use it in GitHub Desktop.
async call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
{ | |
method run() | |
{ | |
my $i = 0; | |
method generate() | |
{ | |
i = 10.rand(); | |
return i; | |
} | |
} | |
} | |
class B{ | |
method run() | |
{ | |
my $b = False; | |
my $i = start {.generate()}; | |
await $i; | |
my $x = $i.result; | |
if $x < 10 | |
{ | |
$b = True; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment