AnyEvent::CallbackStack

Convert nested callback into easy-to-read-write-and-maintain serial style by using Callback Stack
Download

AnyEvent::CallbackStack Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • BlueT - Matthew Lien
  • Publisher web site:
  • http://search.cpan.org/~bluet/

AnyEvent::CallbackStack Tags


AnyEvent::CallbackStack Description

AnyEvent::CallbackStack is a Perl module to convert nested callback into easy-to-read-write-and-maintain serial style by using Callback Stack.SYNOPSISUse AnyEvent::CallbackStack with the following style. use feature 'say'; use AnyEvent::CallbackStack; my $cs = AnyEvent::CallbackStack->new(); $cs->start( %foo ); $cs->add( sub { do_something; $cs->next( $bar, $yohoo ); }); $cv = $cs->last; return $cv; # or http_get http://BlueT.org => sub { $cs->start($_) }; $cs->add( sub { say $_->recv } ); # or $cs->add( sub { say 'I got the ball'; $cs->next( $_->recv ); } ) print 'Your name please?: '; chomp(my $in = < STDIN >); $cs->start($in); $cs->add( sub { say "Lucky you, $_->recv" } );Product's homepage


AnyEvent::CallbackStack Related Software