projects
/
debian
/
amanda
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 3.2.0
[debian/amanda]
/
perl
/
Amanda
/
MainLoop.pm
diff --git
a/perl/Amanda/MainLoop.pm
b/perl/Amanda/MainLoop.pm
index c26ba917452a3d9e732c1ec20ba2abc29387eb83..5fbec198e81b2f8c0ba64526fd90d2611ad3c346 100644
(file)
--- a/
perl/Amanda/MainLoop.pm
+++ b/
perl/Amanda/MainLoop.pm
@@
-437,7
+437,7
@@
first step defined will be called automatically.
my ($hostname, $port, $data, $sendfile_cb) = @_;
my ($addr, $socket); # shared lexical variables
my $steps = define_steps
my ($hostname, $port, $data, $sendfile_cb) = @_;
my ($addr, $socket); # shared lexical variables
my $steps = define_steps
- cb => \$sendfile_cb;
+ cb
_ref
=> \$sendfile_cb;
step lookup_addr => sub {
return async_gethostbyname(hostname => $hostname,
ghbn_cb => $steps->{'got_addr'});
step lookup_addr => sub {
return async_gethostbyname(hostname => $hostname,
ghbn_cb => $steps->{'got_addr'});
@@
-490,7
+490,7
@@
achieve this for all callbacks, add C<< immediate => 1 >> to the C<define_steps>
invocation:
my $steps = define_steps
invocation:
my $steps = define_steps
- cb
=>
$finished_cb,
+ cb
_ref => \
$finished_cb,
immediate => 1;
To do the same for a single step, add the same keyword to the C<step> invocation:
immediate => 1;
To do the same for a single step, add the same keyword to the C<step> invocation:
@@
-509,7
+509,7
@@
commands simultaneously and capture their output:
my $running_commands = 0;
my ($result1, $result2);
my $steps = define_steps
my $running_commands = 0;
my ($result1, $result2);
my $steps = define_steps
- cb_ref => $finished_cb;
+ cb_ref =>
\
$finished_cb;
step start => sub {
$running_commands++;
run_command($command1,
step start => sub {
$running_commands++;
run_command($command1,
@@
-518,15
+518,15
@@
commands simultaneously and capture their output:
run_command($command2,
run_cb => $steps->{'command2_done'});
};
run_command($command2,
run_cb => $steps->{'command2_done'});
};
- step command1_done {
+ step command1_done
=> sub
{
$result1 = $_[0];
$steps->{'maybe_done'}->();
};
$result1 = $_[0];
$steps->{'maybe_done'}->();
};
- step command2_done {
+ step command2_done
=> sub
{
$result2 = $_[0];
$steps->{'maybe_done'}->();
};
$result2 = $_[0];
$steps->{'maybe_done'}->();
};
- step maybe_done {
+ step maybe_done
=> sub
{
return if --$running_commands; # not done yet
$finished_cb->($result1, $result2);
};
return if --$running_commands; # not done yet
$finished_cb->($result1, $result2);
};