-
-
Save lizmat/180e31661db37e16bf52a656bc1bf0cd to your computer and use it in GitHub Desktop.
example of timeout logic
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
sub timeout-after($timeout, $promise) { | |
await Promise.anyof(Promise.in($timeout), $promise); | |
$promise | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment