Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more consistent delay examples
  • Loading branch information
kraih committed Jun 15, 2013
1 parent e2aaff2 commit e28d1fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -449,6 +449,7 @@ event, and multiple ones as a chain of steps.
$end->();
});
}
$delay->wait unless Mojo::IOLoop->is_running;
# Sequentialize multiple events
my $delay = Mojo::IOLoop->delay(
Expand All @@ -471,8 +472,6 @@ event, and multiple ones as a chain of steps.
# Third step (the end)
sub { say 'And done after 5 seconds total.' }
);
# Wait for events if necessary
$delay->wait unless Mojo::IOLoop->is_running;
=head2 generate_port
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojo/IOLoop/Delay.pm
Expand Up @@ -63,6 +63,7 @@ Mojo::IOLoop::Delay - Manage callbacks and control the flow of events
$end->();
});
}
$delay->wait unless Mojo::IOLoop->is_running;
# Sequentialize multiple events
my $delay = Mojo::IOLoop::Delay->new;
Expand All @@ -89,8 +90,6 @@ Mojo::IOLoop::Delay - Manage callbacks and control the flow of events
say 'And done after 5 seconds total.';
}
);
# Wait for events if necessary
$delay->wait unless Mojo::IOLoop->is_running;
=head1 DESCRIPTION
Expand Down

0 comments on commit e28d1fe

Please sign in to comment.