Hi,

On 04/01/2014 16:16, Michael Neumann wrote:
rust-redis: A Redis client library written in pure Rust. Thanks to the new
rust runtime
it is pretty fast, despite being only 200 lines of code.
Just compared that with the one I'm working on (https://github.com/mitsuhiko/redis-rs/) and maybe we can unify those two into one. I plan on continue maintaining mine for a long time to come as I'm using redis very frequently.

My biggest issue currently with continue working on it, is that I want to replicate the pipeline functionality from the Python and JavaScript implementation but I can't see a way of doing that in Rust without having to manually generate code. Macros are not going to be particularly useful.

Primarily the issue is that on the client you want this:

    fn get(&mut self, key: ~str) -> ~str {
        value_as_string(self.execute("GET", [StrArg(key)]))
    }

but on the pipeline you want this behavior:

    let rv = client.pipeline()
          .get("my_key")
          .tap(|s| println!("I got a string: {}", s)
          .get("another_key")
          .execute();

    for result in rv {
        println!("I got result: {}", result);
    }

I am not sure yet how to do this nicely without repeating a lot of code (also I have no idea how to make .tap() work).


Regards,
Armin

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to