Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created October 1, 2014 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitsuhiko/1f37c1092bdf54ce4213 to your computer and use it in GitHub Desktop.
Save mitsuhiko/1f37c1092bdf54ce4213 to your computer and use it in GitHub Desktop.
extern create redis;
fn do_something(con: &redis::Connection) -> redis::RedisResult<i32> {
let (k1, k2) : (i32, i32) = try!(redis::pipe()
.cmd("SET").arg("key_1").arg(42i).ignore()
.cmd("SET").arg("key_2").arg(43i).ignore()
.cmd("GET").arg("key_1")
.cmd("GET").arg("key_2").query(&con));
Ok(k1 + k2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment