-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis cluster async #24
Conversation
@@ -44,7 +44,7 @@ async fn main() -> Result<(), CacheError> { | |||
.with_env_filter(filter) | |||
.init(); | |||
|
|||
let backend = RedisBackend::new().await.unwrap().start(); | |||
let backend = RedisBuilder::single_new().await.unwrap().finish().start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, standalone Redis
sounds much better than single Redis
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming was my weak point. I ain't against this name and agree with you. One question - rename all of these inclusions?
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
- Coverage 68.48% 67.77% -0.72%
==========================================
Files 41 41
Lines 714 723 +9
==========================================
+ Hits 489 490 +1
- Misses 225 233 +8
Continue to review full report at Codecov.
|
hitbox-redis/src/actor.rs
Outdated
/// } | ||
/// ``` | ||
#[cfg(feature = "single")] | ||
pub async fn single_new() -> Result<RedisSingleBackend, Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe RedisBuilder::singlee(address: IntoConnectionInfo)
and
RedisBuilder::cluster(addresses: Vec<IntoConnectionInfo>)
will be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good. It will also allow to get rid of unnecessary structures and build the final backend directly.
hitbox-redis/src/actor.rs
Outdated
/// | ||
/// This backend create connections to redis cluster instance and | ||
/// create actor [RedisBackend], which provides redis as storage [Backend] for hitbox. | ||
/// Its use one [MultiplexedConnection] for asynchronous network interaction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it use multiple Multiplexed connections?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, my mistake
We might still should to wait a bit till the redis-rs/redis-rs#745 done - which introduces the async cluster functionality into the crate and was added from forked lib in this PR |
Closed in favour to #69 |
Hey guys. It may be cool, that hitbox will be able to support redis cluster