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

FreeBSD Manual Pages

  
 
  

home | help
Mixin::Event::DispatchUsersContributed Perl DocuMixin::Event::Dispatch::Bus(3)

NAME
       Mixin::Event::Dispatch::Bus - a message bus

VERSION
       version 2.000

SYNOPSIS
	{
	 package Some::Class;
	 sub bus { shift->{bus}	||= Mixin::Event::Dispatch::Bus->new }
	}
	my $obj	= bless	{}, 'Some::Class';
	$obj->bus->subscribe_to_event(
	 something => sub { my ($ev) = @_; warn	"something!" }
	);
	$obj->bus->invoke_event('something');

DESCRIPTION
       This class uses Mixin::Event::Dispatch to provide a message bus -
       instantiate this	and call the usual methods to deal with	events:

       o   "subscribe_to_event"	in Mixin::Event::Dispatch

       o   "invoke_event" in Mixin::Event::Dispatch

       This allows several classes to share a common message bus, or to	avoid
       polluting a class with event-related methods.

AUTHOR
       Tom Molesworth <cpan@perlsite.co.uk>

LICENSE
       Copyright Tom Molesworth	2014. Licensed under the same terms as Perl
       itself.

perl v5.32.1			  2015-09-14	Mixin::Event::Dispatch::Bus(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | AUTHOR | LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Mixin::Event::Dispatch::Bus&sektion=3&manpath=FreeBSD+13.1-RELEASE+and+Ports>

home | help