-
Notifications
You must be signed in to change notification settings - Fork 593
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
Better connection design for pooling #1435
Comments
Thank you for opening a I just discovered get_multiplexed_async_connection_with_config and AsyncConnectionConfig which does provide a set_push_sender method. It does have a completely different API though. It doesn't use the Msg struct but PushInfo which still requires a bit of parsing to be actually usable. I guess it could be made to work in |
The problem is that the Redis RESP2 makes this distinction. Once a connection is made into a pubsub connection, sending messages on it breaks the pubsub. The way to overcome it is to use RESP3 pubsub, as @bikeshedder mentioned. I don't see a way to overcome this distinction between types for RESP2 - suggestions are welcome.
What's the issue you're experiencing? What interface would you like to see? Something like #1437? |
This hopefully helps clarify some of the issues raised in redis-rs#1435
I see that our current documentation isn't clear enough about this. Would this help? |
It would be nice if I guess the first entry in Edit: Yes, exactly something like #1437 😅 |
I'm currently looking into ways to implement this feature in Alternatively a With the current API I would always need to spawn a tokio task that reads from the channel even if the connection is currently not used for subscriptions. |
So, like this? |
Yes, #1295 does indeed solve this. Any chance getting this merged for the next release of the |
This hopefully helps clarify some of the issues raised in #1435
released 0.27.6 with the updated docs and more lenient push senders - I took your suggestion, and also enabled passing closures, not only senders. |
Very nice. I need to get working on |
@bikeshedder @musjj anything else that is needed, or can this issue be closed? |
I think both the documentation and the API are much better now. 👍 I don't see anything blocking PubSub support in pools anymore. 🥳 |
Yeah, I don't think there's any blockers anymore! |
I was trying to use deadpool with redis-rs, but got stuck when trying to use pubsub with it: bikeshedder/deadpool#226 (comment).
It's also a problem for bb8: djc/bb8#70
It looks like that the way the connection objects are designed makes it hard for third-parties to integrate with it. Quoting the deadpool maintainer @bikeshedder:
I'm not really sure what's the best way forward. Maybe we can have a unified connection object, instead of splitting them? What do you think?
The text was updated successfully, but these errors were encountered: