##
my $done : shared = 0;
my $results : shared;
async {
$results = someLongRunningFunction();
++$done;
};
# do other stuff
...
if( $done ) {
## use $results;
}
####
my $start = time();
my $content : shared;
async{
$content = $lwp->get( $url );
};
sleep 1 while time() < $start +3;
unless( defined $content ) {
## shutdown the socket
}
## use the $content.