Should I use Diesel's R2D2 for non-Diesel things?


#1

I am using both Diesel and Redis and I want to use R2D2 to manage the connection pools for both. Diesel brings its own R2D2 so now I have two options that I am uncomfortable with:

  1. Use two versions of R2D2. The one bundled with Diesel for Diesel and one in my Cargo.toml for Redis.
  2. Use the R2D2 bundled with Diesel for both Diesel and Redis and pray Diesel R2D2 is compatible with r2d2_redis.

Here are the relevant lines in my [dependencies]:

diesel = { version = "1.2", features = ["r2d2", "postgres", "uuid"] }
# r2d2_redis = "0.7"