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

add pool for pubsub connections #159

Closed
wants to merge 2 commits into from
Closed

Conversation

bbaldino
Copy link

Based on discussion in #70

redis/src/lib.rs Outdated
}

async fn is_valid(&self, _conn: &mut Self::Connection) -> Result<(), Self::Error> {
// TODO:
Copy link
Author

Choose a reason for hiding this comment

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

Something needs to be done here, but not sure what would be best for a PubSub.

Copy link
Owner

Choose a reason for hiding this comment

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

Maybe punsubscribe() with an empty pattern?

Copy link
Author

Choose a reason for hiding this comment

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

Good idea. Made that change, just trying to validate a few things.

@bbaldino
Copy link
Author

Ok, pushed the logic for is_valid. Unfortunately I wasn't able to really validate some things in my use case (due to other issues), and didn't see any unit tests in the redis that I could expand on. If there's anything you think might be risky here (bug-wise) we can hold off.

@codecov
Copy link

codecov bot commented May 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: -1.83 ⚠️

Comparison is base (040b7dc) 74.28% compared to head (1846e2d) 72.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #159      +/-   ##
==========================================
- Coverage   74.28%   72.45%   -1.83%     
==========================================
  Files           6        6              
  Lines         556      570      +14     
==========================================
  Hits          413      413              
- Misses        143      157      +14     
Impacted Files Coverage Δ
redis/src/lib.rs 3.12% <0.00%> (-2.44%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@djc
Copy link
Owner

djc commented May 19, 2023

Ok, pushed the logic for is_valid. Unfortunately I wasn't able to really validate some things in my use case (due to other issues), and didn't see any unit tests in the redis that I could expand on. If there's anything you think might be risky here (bug-wise) we can hold off.

I mean, if you can't validate this stuff, why are we considering this for inclusion?

@bbaldino
Copy link
Author

Ok, pushed the logic for is_valid. Unfortunately I wasn't able to really validate some things in my use case (due to other issues), and didn't see any unit tests in the redis that I could expand on. If there's anything you think might be risky here (bug-wise) we can hold off.

I mean, if you can't validate this stuff, why are we considering this for inclusion?

Well, the basic functionality (retrieving a connection) does work, it's the is_valid I haven't been able to specifically test. I did say that if we want to hold off on merging until I get a chance to more directly test that part, then by all means let's do that, but:

  1. There are no unit tests in bb8_redis, so for all I knew maybe this isn't something you were all that worried about.
  2. The code itself is pretty simple, perhaps by reading it alone you (who has more experience than me) are able to feel confident about its correctness.

So was merely trying to defer to you on how you wanted to move forward.

@djc
Copy link
Owner

djc commented May 26, 2023

Even though we have no tests, given that the entire idea of using punsubscribe this way is sort of experimental, I would prefer to see if it works in practice at least once before merging this.

@bbaldino
Copy link
Author

Sorry for the lack of follow-up here...we ended up going in a different direction (no longer using redis due to other reasons), so I likely won't have time to come back to this.

@djc djc closed this Jun 14, 2023
@djc
Copy link
Owner

djc commented Jun 14, 2023

No problem, thanks for following up! I'll close this -- if someone else wants it, please submit a new PR.

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.

2 participants