Mixin::...tch::Bus(3)

πŸ“¦ version 2.000, in alpine 3.24

🌸 NAME 🌸

okay so you're on the Mixin::...tch::Bus(3) page β€” yes bestie, that's the manual name, and this is the User Contributed Perl Documentation vibe. The actual module is Mixin::Event::Dispatch::Bus, and it is literally a message bus. no cap. πŸ’…

✨ VERSION ✨

version 2.000 β€” that's the version, periodt. πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole idea in code, and yes you can copy it exactly:

{
 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, bestie:

  • subscribe_to_event in Mixin::Event::Dispatch
  • 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. it's giving shared-group-chat energy, but for events. 🫢

πŸŽ€ AUTHOR πŸŽ€

Tom Molesworth <cpan@perlsite.co.uk> β€” iconic author behavior, fr fr. πŸ‘‘

πŸ”₯ LICENSE πŸ”₯

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


and that's the whole page, bestie πŸ’– β€” the sign-off says source/version perl v5.42.2, dated 2026-02-15, and the manual is Mixin::...tch::Bus(3). πŸ¦‹βœ¨

πŸ“¦ where this page comes from