The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mercury::Pattern::Bus - A messaging pattern where all peers share messages

VERSION

version 0.016

SYNOPSIS

DESCRIPTION

ATTRIBUTES

peers

The list of peers connected to this bus.

METHODS

add_peer

    $pat->add_peer( $tx )

Add the given connection as a peer to this bus.

remove_peer

Remove the connection from this bus. Called automatically by the finish handler.

send_message

    $pat->send_message( $message, $from )

Send a message to all the peers on this bus. If a $from websocket is specified, will not send to that peer (they should know what they sent).

SEE ALSO

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.