Async-Chain

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

                   $next->($status, $message);
               },
               log => sub {
                   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 {

lib/Async/Chain.pm  view on Meta::CPAN

        },
        log => sub {
            my next = shift;
            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 {



( run in 0.698 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )