As long as people construct the IO and pass that driver pre-constructed to such an API it is possible to do whatever you want. But forClusterthat becomes a bit more tricky. Then again never used that api myself so not sure if that's too bad r2d2is for now also not supported sans-i...
I'm starting this thread to discuss whether it's a good idea to implement bb8 support in redis-rs directly, similar to how we do it for r2d2. I personally believe that will be good for the overall benefits around redis-rs and bb8. bb8 has native redis-rs support by bb8-redis bb8 ...
背景 我正在开发一个通过r2d2使用diesel的actix-web应用程序,我不确定如何最好地进行异步查询。我找到了三个看似合理的选择,但不确定哪一个是最好的。如果我没看错代码,r2d2会在获取连接时阻塞其线程,这将阻塞核心actix-web池的一部分。与数据库查询相同。如果我执行的查询多于池中的线程数,这会阻塞所有的actix-...
5 changes: 5 additions & 0 deletions 5 redis/src/r2d2.rs Show comments View file Edit file Delete file This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode ch...
redis = { version = "0.29.1", features = ["r2d2"] } For async connections, connection pooling isn't necessary, unless blocking commands are used. The MultiplexedConnection is cloneable and can be used safely from multiple threads, so a single connection can be easily reused. For automatic ...
let pool = r2d2::Pool::builder() .max_size(cfg.get_int("redis-cluster.options.max_size").unwrap_or(20) as u32) .min_idle(Some( cfg.get_int("redis-cluster.options.min_idle").unwrap_or(10) as u32, )) .connection_timeout(Duration::from_secs( cfg.get_int("redis-cluster.options...
5 changes: 5 additions & 0 deletions 5 redis/src/r2d2.rs Show comments View file Edit file Delete file This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode ch...