Async::Group

Async::Group is a Perl class to deal with simultaneous asynchronous calls.
Download

Async::Group Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Dominique Dumont
  • Publisher web site:

Async::Group Tags


Async::Group Description

Async::Group is a Perl class to deal with simultaneous asynchronous calls. Async::Group is a Perl class to deal with simultaneous asynchronous calls.SYNOPSIS use Async::Group ; use strict ; sub sub1 { print "Dummy subroutine n"; my $dummy = shift ; my $cb = shift ; &$cb(1); } sub allDone { print "All done, result is ", shift ,"n" ; } my $a = Async::Group->new(name => 'aTest', test => 1) ; $a->run(set => , callback => &allDone ) # or another way which avoids the clumsy nested subs my $cb = $a->getCbRef(); $a->run(set => , callback => &allDone )If you sometimes have to launch several asynchronous calls in parrallel and want to call one call-back function when all these calls are finished, this module may be for you.Async::Group is a class which enables you to call several asynchronous routines. Each routine may have their own callback. When all the routine are over (i.e. all their callback were called), Async::Group will call the global callback given by the user.Note that one Async::Group objects must be created for each group of parrallel calls. This object may be destroyed (or will vanish itself) once the global callback is called.Note also that Async::Group does not perform any fork or other system calls. It just run the passed subroutines and keep count of the call-back functions called by the aforementionned subroutines. When all these subs are finished, it calls another call-back (passed by the user) to perform whatever function required by the user.Using fork or threads or whatever is left to the user. Requirements: · Perl


Async::Group Related Software