darkredis : A Redis client based on std::future and async_await

Documentation Build Status Crates.io Status

darkredis is a Redis client for Rust written using the new std::future and async_await. It's designed to be easy to use, and lacks advanced features. Requires rust 1.39.0 or newer.

Currently not all Redis commands have convenience functions, and there may be ergonomic improvements to make.

Why?

When darkredis was originally written, it was part of an async project. At the time, there was no real way to use .await with redis-rs, so I set out to change that. The result is darkredis, and it has worked very well for my own personal use, which it might for you too. It's designed to be as simple as possible, serving as an easy way to call redis commands.

Cargo features

Getting started

```rust use darkredis::ConnectionPool;

[tokio::main]

async fn main() -> darkredis::Result<()> { let pool = ConnectionPool::create("127.0.0.1:6379".into(), None, num_cpus::get()).await?; let mut conn = pool.get().await;

//And away!
conn.set("secret_entrance", b"behind the bookshelf").await?;
let secret_entrance = conn.get("secret_entrance").await?;
assert_eq!(secret_entrance, Some("behind the bookshelf".into()));

//Keep our secrets
conn.del("secret_entrance").await?;

Ok(())

} ```

Changelog

0.4.1

Testing

If you're hacking on darkredis and want to run the tests, make sure you have a Redis instance running on your local machine on port 6379. The tests clean up any keys set by themselves, unless the test fails. Please submit an issue if it does not.

Also, make sure to run the tests using both the runtime_tokio and runtime_agnostic features, to make sure that it works.