redis-async-rs
redis-async-rs copied to clipboard
how is it different from https://github.com/mitsuhiko/redis-rs
I am in process of exploring these two libraries. My use case is that i need it to run on top of tokio and support future. Could you please tell how it is different from mitsuhiko/redis-rs as i can see support of future and aio in this library as well?
Also i need a persistent TCP connection. May be a couple of them and would like to multiplex my commands over these persistent connections.
Hello,
When I started this library mitsuhiko/redis-rs didn't have async support, that's a more recent addition. But because of those different histories the two libraries have quite different APIs.
For example, my library is deliberately quite low-level, it delegates responsibility to the client app to form Redis commands in the correct structure (so that it maintains compatibility with a wider range of Redis versions). Other libraries have higher-level functions for each Redis command.
There is also a third client which is newer than both: https://crates.io/crates/fred which may also suit your purposes, although I haven't used it so I'm not sure of it's functionality.
Regarding multiplexing commands: redis-async certainly supports that, a PairedConnection (returned in a future from: https://docs.rs/redis-async/0.4.5/redis_async/client/paired/fn.paired_connect.html) is cheaply cloneable, each clone is handle on the same underlying TCP connection and commands issued are multiplexed on to the same connection.
However, my understanding of the other two is they support similar functionality but implemented in slightly different ways.
Hope this helps put everything in to context.