my $c = channel("Message"); say "Listening"; loop { my $timeout = Promise.in(1.75); my $result = start { $c.receive } my $combined = Promise.anyof( $result , $timeout); await $combined.then({ if $result { say $result.result; } else { say 'timeout'; } }) }