Async-Chain
view release on metacpan or search on metacpan
my next = shift;
my ($status, $message) = @_;
...
log(...);
};
RATIONALE
A asynchronous code often have deep nested callbacks, therefore it is
tangled and hard to change. This module help to converta a code like
following to some more readable form. Also, with "chain" you can easily
skip some unneeded steps in this thread. For example jump to log step
after the first failed query in the chain.
without chain:
sub f {
...
some_anync_call @args, cb => sub {
...
some_other_anync_call @args, cb => sub {
...
lib/Async/Chain.pm view on Meta::CPAN
my ($status, $message) = @_;
...
log(...);
};
=head1 RATIONALE
A asynchronous code often have deep nested callbacks, therefore it is tangled
and hard to change. This module help to converta a code like following to some
more readable form. Also, with C<chain> you can easily skip some unneeded steps
in this thread. For example jump to log step after the first failed query in
the chain.
without chain:
sub f {
...
some_anync_call @args, cb => sub {
...
some_other_anync_call @args, cb => sub {
...
( run in 0.288 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )