The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Peep::Scheduler - Perl extension for scheduling events for Peep, the Network Auralizer.

SYNOPSIS

  use Net::Peep::Scheduler;
  my $scheduler = new Net::Peep::Scheduler;

  $scheduler->schedulerAddEvent(
    'test_program', 6, 0, 'test_event', \&handler, $data);

  $scheduler->schedulerExplicitWakeUp();

DESCRIPTION

Net::Peep::Scheduler provides methods for scheduling events to run concurrently, using sigalarm. The scheduler makes use of Time::HiRes to allow scheduling of events up to microsecond accuracy. Scheduled events will always be played in order of soonest scheduled time, regardless of the order the events were fed to the scheduler.

Note that this module also defines its own debugging level - 8. That's one notch below 'Whoa Nelly', so use with extreme prejudice.

EXPORT

None by default.

CLASS ATTRIBUTES

  $VERSION - The CVS revision of this module.

PUBLIC METHODS

  new() - Net::Peep::Scheduler constructor.

  schedulerAddEvent($app_name, $future_secs, $future_usecs,
                    $type, $handler_coderef, $handler_data)
  Schedules an event for $future_secs seconds and
  $future_usecs microseconds in the future. When the event
  occurs, the $handler_coderef is executed and passed
  whatever data is referenced by $handler_data. The
  application should also identify itself via $app_name and
  register the type of event with $type.

  scheduleExplicitWakeUp() - Tells the scheduler explicitly
  to wake up and execute the closest scheduled event.

AUTHOR

Michael Gilfix <mgilfix@eecs.tufts.edu> Copyright (C) 2001

SEE ALSO

perl(1), peepd(1), Net::Peep::BC, Net::Peep::Client, Net::Peep::Log.

http://peep.sourceforge.net

CHANGE LOG

$Log: Scheduler.pm,v $ Revision 1.2 2001/08/08 20:17:57 starky Check in of code for the 0.4.3 client release. Includes modifications to allow for backwards-compatibility to Perl 5.00503 and a critical bug fix to the 0.4.2 version of Net::Peep::Conf.

Revision 1.1 2001/06/04 06:53:09 starky A scheduler for events requiring the sigalrm signal for handling. See the PODs for more detail.