++ed by:

1 PAUSE user

Jon Portnoy


IRC::Indexer::Trawl::Multi - Trawl multiple IRC servers


  ## Inside a POE session:
  my $multi = IRC::Indexer::Trawl::Multi->new(
    Servers => [
      [ 'phoenix.xyloid.org', '7000' ],
        Server => 'irc.netlandtowers.com',
        Port   => 7000,
        UseIPV6 => 1,
        . . . 
      . . .
    ## For other opts, see: perldoc IRC::Indexer::Trawl::Bot
  ## Later:
  if ( $multi->done ) {
    my $trawled = $multi->dump;
    for my $server (keys %$trawled) {
      ## The server information hash:
      my $this_hash    = $trawled->{$server};
      ## Get IRC::Indexer::Trawl::Bot object:
      my $this_trawler = $multi->trawler($server);
      ## Get IRC::Indexer::Report::Server object:
      my $this_info    = $this_trawler->info;
      ## For parsing details, see:
      ##  perldoc IRC::Indexer::Trawl::Bot
      ##  perldoc IRC::Indexer::Report::Server
  } else {
    ## Active trawlers remain.


A simple manager for groups of IRC::Indexer::Trawl::Bot instances.

This is mostly an example; it is not used by any of the included controllers and is not at all sophisticated. You're probably better off managing your own pool of IRC::Indexer::Trawl::Bot sessions.

Given an array (reference) of server addresses, it will spawn trawlers for each server that run in parallel; when they're all finished, done() will return boolean true and dump() will return a hash reference, keyed on server name, of IRC::Indexer::Trawl::Bot netinfo() hashes.

Servers option in constructor also accepts per-server hash references created out of server spec files.


Example module, mostly; hardly tested. Lacks a useful postback interface. Patches welcome :-)


Jon Portnoy <avenj@cobaltirc.org>