Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Net::Analysis::DispatcUser3Contributed Perl DocumeNet::Analysis::Dispatcher(3)

NAME
       Net::Analysis::Dispatcher - handle the event stuff for the proto
       analysers

SYNOPSIS
	 use Net::Analysis::Dispatcher;

	 my $d = Net::Analysis::Dispatcher->new();
	 my $listener =	Net::Analysis::Listener::TCP->new();
	 $d->add_listener (listener => $listener);

DESCRIPTION
       This class is used to register listener objects.	Whenever any of	the
       objects emit an event, the dispatcher is	used to	make sure other
       interested listeners receive the	event.

   new ()
       Takes no	arguments, tells no lies.

   add_listener	(listener => $obj, config => $hash)
       This method adds	a new listener to the list of things to	be notified of
       each event.

       If the listener object has a field "pos", then we attempt to put	the
       listener	in that	position in the	event queue. Valid values are "first"
       and "last", to receive events first and last. Listener::TCP likes to be
       first, since it adds extra info to the "tcp_packet" that	other modules
       might like to see.

       If a listener has already claimed the first or last spot, then we croak
       with an error.

   emit_event (name => 'event_name', args => $hash)
       The name	must be	a valid	Perl function name. By convention, it should
       start with the name of the module that is emitting the event (e.g.
       "http_transaction").

       Where your code is emitting events, it must must	document the args in
       detail, so that listeners will know what	to do with them.

       This method runs	through	the listener list, and if appropriate, invokes
       the listening method for	each listener.

       A listener gets the event if it has a method which has the same name as
       the "event_name".

   EXPORT
       None by default.

SEE ALSO
       Net::Analysis::Listener::Base

AUTHOR
       Adam B. Worrall,	<adam@cpan.org>

COPYRIGHT AND LICENSE
       Copyright (C) 2004 by Adam B. Worrall

       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself, either Perl	version	5.8.5 or, at
       your option, any	later version of Perl 5	you may	have available.

   emit_event (name => 'event_name', args => $hash)
       The name	must be	a valid	Perl function name. By convention, it should
       start with the name of the module that is emitting the event (e.g.
       "http_transaction").

       Where your code is emitting events, it must must	document the args in
       detail, so that listeners will know what	to do with them.

       This method runs	through	the listener list, and if appropriate, invokes
       the listening method for	each listener.

       A listener gets the event if it has a method which has the same name as
       the "event_name".

perl v5.24.1			  2010-03-31	  Net::Analysis::Dispatcher(3)

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Net::Analysis::Dispatcher&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help