Skip to content

Commit

Permalink
mention that wait works the same for chains of promises
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 30, 2017
1 parent 94044da commit a1d86b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Mojo/IOLoop/Delay.pm
Expand Up @@ -272,7 +272,7 @@ that leads to the next closure in the series when executed.
use Mojo::IOLoop;
# Instead of nested closures we now have a simple chain
# Instead of nested closures we now have a simple chain of steps
my $delay = Mojo::IOloop->delay(
sub {
my $delay = shift;
Expand All @@ -297,8 +297,9 @@ that leads to the next closure in the series when executed.
Another positive side effect of this pattern is that we do not need to call
L<Mojo::IOLoop/"start"> and L<Mojo::IOLoop/"stop"> manually, because we know
exactly when our series of closures has reached the end. So L</"wait"> can stop
the event loop automatically if it had to be started at all in the first place.
exactly when our series of L</"steps"> and/or chain of promises has reached the
end. So L</"wait"> can stop the event loop automatically if it had to be started
at all in the first place.
=head1 EVENTS
Expand Down

0 comments on commit a1d86b7

Please sign in to comment.