Created
May 21, 2016 14:40
-
-
Save anonymous/b8007346f2b7f342ae2ced3fdc59ab22 to your computer and use it in GitHub Desktop.
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
use 5.20.0; | |
my $whileStep = 0; | |
Mojo::IOLoop->delay( | |
sub { | |
my ($d, $err, $rval) = @_; | |
if ($whileStep++) { | |
die {err => $err} if $err; | |
# goto next step | |
return $d->pass if !$rval; | |
# do something with $rval | |
# .. | |
} | |
unshift @{$d->remaining}, __SUB__; | |
$c->doWhileTrue($d->begin); | |
}, | |
)->catch(..); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment