AnyEvent-RipeRedis
view release on metacpan or search on metacpan
other commands, except for additional `SUBSCRIBE`, `PSUBSCRIBE`,
`UNSUBSCRIBE`, `PUNSUBSCRIBE` and `QUIT` commands.
The detailed information about Redis Pub/Sub can be found here:
[http://redis.io/topics/pubsub](http://redis.io/topics/pubsub)
## subscribe( @channels, ( $cb->( $msg, $channel ) | \\%cbs ) )
Subscribes the client to the specified channels.
Method can accept two callbacks: `on_reply` and `on_message`. The `on_reply`
callback is called when subscription to all specified channels will be
activated. In first argument to the callback is passed the number of channels
we are currently subscribed. If subscription to specified channels was lost,
the `on_reply` callback is called with the error object in the second argument.
The `on_message` callback is called on every published message. If the
`subscribe` method is called with one callback, this callback will be act as
`on_message` callback.
$redis->subscribe( qw( foo bar ),
- E\_CLUSTER\_DOWN
The cluster is down or hash slot not served.
# DISCONNECTION
When the connection to the server is no longer needed you can close it in three
ways: call the method `disconnect()`, send the `QUIT` command or you can just
"forget" any references to an AnyEvent::RipeRedis object, but in this
case the client object is destroyed without calling any callbacks, including
the `on_disconnect` callback, to avoid an unexpected behavior.
## disconnect()
The method for synchronous disconnection. All uncompleted operations will be
aborted.
## quit( \[ $cb->( $reply, $err ) \] )
The method for asynchronous disconnection.
lib/AnyEvent/RipeRedis.pm view on Meta::CPAN
other commands, except for additional C<SUBSCRIBE>, C<PSUBSCRIBE>,
C<UNSUBSCRIBE>, C<PUNSUBSCRIBE> and C<QUIT> commands.
The detailed information about Redis Pub/Sub can be found here:
L<http://redis.io/topics/pubsub>
=head2 subscribe( @channels, ( $cb->( $msg, $channel ) | \%cbs ) )
Subscribes the client to the specified channels.
Method can accept two callbacks: C<on_reply> and C<on_message>. The C<on_reply>
callback is called when subscription to all specified channels will be
activated. In first argument to the callback is passed the number of channels
we are currently subscribed. If subscription to specified channels was lost,
the C<on_reply> callback is called with the error object in the second argument.
The C<on_message> callback is called on every published message. If the
C<subscribe> method is called with one callback, this callback will be act as
C<on_message> callback.
$redis->subscribe( qw( foo bar ),
lib/AnyEvent/RipeRedis.pm view on Meta::CPAN
The cluster is down or hash slot not served.
=back
=head1 DISCONNECTION
When the connection to the server is no longer needed you can close it in three
ways: call the method C<disconnect()>, send the C<QUIT> command or you can just
"forget" any references to an AnyEvent::RipeRedis object, but in this
case the client object is destroyed without calling any callbacks, including
the C<on_disconnect> callback, to avoid an unexpected behavior.
=head2 disconnect()
The method for synchronous disconnection. All uncompleted operations will be
aborted.
=head2 quit( [ $cb->( $reply, $err ) ] )
The method for asynchronous disconnection.
lib/AnyEvent/RipeRedis/Error.pm view on Meta::CPAN
1;
__END__
=head1 NAME
AnyEvent::RipeRedis::Error - Class of error for AnyEvent::RipeRedis
=head1 DESCRIPTION
Class of error for L<AnyEvent::RipeRedis>. Objects of this class can be passed
to callbacks.
=head1 CONSTRUCTOR
=head2 new( $err_msg, $err_code )
Creates error object.
=head1 METHODS
=head2 message()
( run in 2.831 seconds using v1.01-cache-2.11-cpan-9b1e4054eb1 )