Skip to content

Commit

Permalink
show how to combine arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 25, 2014
1 parent c9bf5dd commit 175bacc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Mojo/IOLoop/Delay.pm
Expand Up @@ -215,6 +215,15 @@ passed together to the next step or L</"finish"> event.
Mojo::IOLoop->client({port => 3000} => $delay->begin(1, 1));
$delay->wait;
# Capture and combine arguments
my $delay = Mojo::IOLoop->delay(sub {
my ($delay, $three_err, $three_stream, $four_err, $four_stream) = @_;
...
});
Mojo::IOLoop->client({port => 3000} => $delay->begin);
Mojo::IOLoop->client({port => 4000} => $delay->begin);
$delay->wait;
=head2 data
my $hash = $delay->data;
Expand Down

0 comments on commit 175bacc

Please sign in to comment.