Skip to content

Instantly share code, notes, and snippets.

Created April 6, 2017 18:49
Show Gist options
  • Save anonymous/3fc0820fc8b7612ba42e7cc03ff446ee to your computer and use it in GitHub Desktop.
Save anonymous/3fc0820fc8b7612ba42e7cc03ff446ee to your computer and use it in GitHub Desktop.
async call
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