Skip to content

Commit

Permalink
update redis multiplex docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaemk committed Jun 3, 2023
1 parent 4074721 commit b2534a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
5 changes: 5 additions & 0 deletions src/stores/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit b2534a3

Please sign in to comment.