diff --git a/README.md b/README.md index e7a0157..d7540f0 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ of un-cached arguments, specify `#[cached(sync_writes = true)]` / `#[once(sync_w - `redis_store`: Include Redis cache store - `redis_async_std`: Include async Redis support using `async-std` and `async-std` tls support, implies `redis_store` and `async` - `redis_tokio`: Include async Redis support using `tokio` and `tokio` tls support, implies `redis_store` and `async` -- `redis_connection_manager`: Enable the optional `connection-manager` feature of `redis` and use the manager instead of a `MultiplexedConnection` +- `redis_connection_manager`: Enable the optional `connection-manager` feature of `redis`. Any async redis caches created + will use a connection manager instead of a `MultiplexedConnection` - `redis_ahash`: Enable the optional `ahash` feature of `redis` - `wasm`: Enable WASM support. Note that this feature is incompatible with `tokio`'s multi-thread runtime (`async_tokio_rt_multi_thread`) and all Redis features (`redis_store`, `redis_async_std`, `redis_tokio`, `redis_ahash`) diff --git a/src/lib.rs b/src/lib.rs index 7c73a65..41fdd08 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,6 +28,8 @@ of un-cached arguments, specify `#[cached(sync_writes = true)]` / `#[once(sync_w - `redis_store`: Include Redis cache store - `redis_async_std`: Include async Redis support using `async-std` and `async-std` tls support, implies `redis_store` and `async` - `redis_tokio`: Include async Redis support using `tokio` and `tokio` tls support, implies `redis_store` and `async` +- `redis_connection_manager`: Enable the optional `connection-manager` feature of `redis`. Any async redis caches created + will use a connection manager instead of a `MultiplexedConnection` - `redis_ahash`: Enable the optional `ahash` feature of `redis` - `wasm`: Enable WASM support. Note that this feature is incompatible with `tokio`'s multi-thread runtime (`async_tokio_rt_multi_thread`) and all Redis features (`redis_store`, `redis_async_std`, `redis_tokio`, `redis_ahash`) diff --git a/src/stores/redis.rs b/src/stores/redis.rs index c4714b0..9c67583 100644 --- a/src/stores/redis.rs +++ b/src/stores/redis.rs @@ -453,6 +453,8 @@ mod async_redis { } } + /// Create a multiplexed redis connection. This is a single connection that can + /// be used asynchronously by multiple futures. #[cfg(not(feature = "redis_connection_manager"))] async fn create_multiplexed_connection( &self, @@ -463,6 +465,9 @@ mod async_redis { Ok(conn) } + /// Create a multiplexed connection wrapped in a manager. The manager provides access + /// to a multiplexed connection and will automatically reconnect to the server when + /// necessary. #[cfg(feature = "redis_connection_manager")] async fn create_connection_manager( &self,