Skip to content
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

Closed
wants to merge 7 commits into from
Closed

Conversation

topenkoff
Copy link
Member

Hey guys. It may be cool, that hitbox will be able to support redis cluster

@@ -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();
Copy link
Contributor

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?

Copy link
Member Author

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-commenter
Copy link

codecov-commenter commented Aug 8, 2021

Codecov Report

Merging #24 (48f46cb) into master (b8ef10e) will decrease coverage by 0.71%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
hitbox-actix/src/builder.rs 21.73% <ø> (ø)
hitbox-derive/src/cacheable_macro.rs 0.00% <0.00%> (ø)
hitbox-redis/src/actor.rs 64.93% <55.55%> (-8.20%) ⬇️
hitbox-actix/src/actor.rs 88.88% <100.00%> (-1.12%) ⬇️
hitbox-redis/tests/integration_test.rs 100.00% <100.00%> (ø)
hitbox/src/response.rs 19.23% <0.00%> (+3.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8ef10e...48f46cb. Read the comment docs.

/// }
/// ```
#[cfg(feature = "single")]
pub async fn single_new() -> Result<RedisSingleBackend, Error> {
Copy link
Member

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?

Copy link
Member Author

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.

///
/// 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.
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, my mistake

@topenkoff
Copy link
Member Author

topenkoff commented Jan 11, 2023

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

@singulared
Copy link
Member

Closed in favour to #69

@singulared singulared closed this Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants