NAME
Mojolicious::Plugin::RedisSubscriber
SYNOPSIS
use Mojolicious::Plugin::RedisSubscriber;
my $redis = Mojolicious::Plugin::RedisSubscriber->new;
my $cb = $redis->subscribe("feed::frxEURUSD", sub { ... });
...;
$redis->unsubscribe("feed::frxEURUSD", $cb);
DESCRIPTION
Module subscribes to specified channels and emits events when there are messages.
METHODS
Module provides the following methods:
$self->channel_hash
Returns the underlying subscriber object.
$self->channels
Returns reference to list of channel names to which redis is subscribed.
$self->redis
returns the underlying redis server object.
$self->subscribe($channel => $callback)
Ensures that module subscribed to specified redis channels and adds $callback to the list invoked when there's a message in channel
$self->unsubscribe($channel => $callback)
Unsubscribes $callback from the $channel
FEATURES NOT YET SUPPORTED
Configuration vs config yml files, particularly regarding default channels
LICENSE AND COPYRIGHT
Copyright (C) 2015 Regent Markets. This may be distributed under the same terms as Perl itself.