Struct redis_client::redis::RedisClientAsync
[−]
[src]
pub struct RedisClientAsync { // some fields omitted }
Methods
impl RedisClientAsync
A RedisClientAsync is a structure to send command to redis and receive the response asynchronously.
When creating a RedisClientAsync 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::RedisClientAsync::new("127.0.0.1", "6379"));
fn new(host: &'static str, port: &'static str) -> Result<RedisClientAsync, RedisError>
fn exec_redis_pipeline_command_async<F>(&mut self, redis_command: &mut RedisCommand, callback: F) -> Result<(), RedisError> where F: Fn(Result<Vec<RedisResult>, RedisError>), F: Send + 'static
Execute a redis pipeline command. The 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 exec_redis_command_async<F>(&mut self, redis_command: &mut RedisCommand, callback: F) -> Result<(), RedisError> where F: Fn(Result<RedisResult, RedisError>), F: Send + 'static
Execute a redis command. The 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 execute the callbacks with them. If no result are ready this function will return.