Struct redis_client::redis::PubSubClientAsync
[−]
[src]
pub struct PubSubClientAsync { // some fields omitted }
Methods
impl PubSubClientAsync
A PubSubClientAsync is a structure to use redis publish/subscribe functionnality.
When creating a PubSubClientAsync it will automatically create a connection. Therefore when it is created it uses the host and the port.
Example:
let mut client = try!(redis_client::PubSubClientAsync::new("127.0.0.1", "6379"));
fn new(host: &'static str, port: &'static str) -> Result<PubSubClientAsync, RedisError>
fn exec_redis_command_async<F>(&mut self, redis_command: &mut RedisCommand, cmd_callback: F, pubsub_arg: PubSubArg) -> Result<(), RedisError> where F: Fn(Result<RedisResult, RedisError>), F: Send + 'static
Execute a redis command. The cmd_callback will be called once the command execution is over and the pump method is called. The return value indicates if the command was successfully launched.
fn pump(&mut self) -> Result<(), RedisError>
Pump the result and the received value and execute the callbacks with them. If no result or received value are ready this function will return.