NAME

Mercury::Controller::Bus - A messaging pattern where all subscribers share messages

VERSION

version 0.016

SYNOPSIS

DESCRIPTION

METHODS

connect

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.

This is a shorter way of doing both /pub/*topic and /sub/*topic, without the hierarchical message passing.

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.

$ua->websocket('/bus/foo?echo=1' => sub { ... });

post

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.

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.