![]() |
![]()
| ![]() |
![]()
NAMEMixin::Event::Dispatch::Bus - a message bus VERSIONversion 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'); DESCRIPTIONThis class uses Mixin::Event::Dispatch to provide a message bus - instantiate this and call the usual methods to deal with events:
This allows several classes to share a common message bus, or to avoid polluting a class with event-related methods. AUTHORTom Molesworth <cpan@perlsite.co.uk> LICENSECopyright Tom Molesworth 2014. Licensed under the same terms as Perl itself.
|