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.

Trait Implementations

impl PubSubCommandAsync for PubSubClientAsync

fn subscribe<C: ToString, G: Fn(Result<RedisResult, RedisError>), S: Fn(RedisResult)>(&mut self, channel: C, cmd_callback: G, callback: S) -> Result<(), RedisError> where G: Send + 'static, S: Send + 'static

fn psubscribe<C: ToString, G: Fn(Result<RedisResult, RedisError>), S: Fn(RedisResult)>(&mut self, channel: C, cmd_callback: G, callback: S) -> Result<(), RedisError> where G: Send + 'static, S: Send + 'static

fn publish<C: ToString, M: ToString, G: Fn(Result<RedisResult, RedisError>)>(&mut self, channel: C, message: M, cmd_callback: G) -> Result<(), RedisError> where G: Send + 'static

impl Debug for PubSubClientAsync

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for PubSubClientAsync

fn fmt(&self, f: &mut Formatter) -> Result