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 PubSub #226
Comments
It could be possible to provide this feature by implementing some clever wrapping utilizing the In the mean time the easiest way to get a let obj = deadpool_redis::Connection::take(pool.get().await?);
let pubsub = obj.into_pubsub(); Due to the |
I'm closing this as I don't think it's very practical to use a pool for listening for messages. I might be totally wrong so please feel free to comment here and/or open a new issue describing a use case where this is needed. |
Yep your right, this ended up being an issue with the redis pubsub implementation itself. I think it was a third party library which was merged into it? |
Would keyspace notifications be a use case? I need to know about changes to a particular key, but once they've happened, I'm done with it. |
I'm also interested in a pooled pubsub usecase. We're using an adhoc pubsub channel to add some request/response type semantic; a stream for the return channel means that the data would be persisted, and we want something more ephemeral so we don't have to worry about cleanup, so looking at using pubsub. Pubsub works well, but creating a new connection every time isn't very efficient. |
This comment was marked as outdated.
This comment was marked as outdated.
I once again fell into the trap of confusing #226 (comment) is still correct about the way it needs to be implemented. The connection wrapper needs to provide a |
Would that solution be a workaround because of the current limitations in My eventual solution was to write a custom PubSub implementation for my specific usecase and use deadpool for the plain TCP connections, but obviously that was a heavy-handed approach 🙂 |
There's a
.publish()
method in deadpool redis but I can't find any way to subscribe to channels for pubsub usage in redis. How should I go about this, and are there any async alternatives if deadpool doesn't support it?The text was updated successfully, but these errors were encountered: