Mercury::Controller::Bus - A messaging pattern where all subscribers share messages
version 0.010
Establish a WebSocket message bus to send/receive messages on the given topic. All clients connected to the topic will receive all messages published on the topic.
topic
This is a shorter way of doing both /pub/*topic and /sub/*topic, without the hierarchical message passing.
/pub/*topic
/sub/*topic
One difference is that by default a sender will not receive a message that they sent. To enable this behavior, pass a true value as the echo query parameter when establishing the websocket.
echo
$ua->websocket('/bus/foo?echo=1' => sub { ... });
Post a new message to the given topic without subscribing or establishing a WebSocket connection. This allows new messages to be pushed by any HTTP client.
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2016 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.
To install Mercury, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mercury
CPAN shell
perl -MCPAN -e shell install Mercury
For more information on module installation, please visit the detailed CPAN module installation guide.