miniredis
miniredis copied to clipboard
Support of keyspace events
Maybe I didnt get it but when is use miniredis instead of go-redis and listening to the keypace events like:
client := redis.NewClient(&redis.Options{
Addr: s.Addr(),
})
client.ConfigSet("notify-keyspace-events", "Kx")
...
sub := client.PSubscribe("__keyspace@0__:" + key)
_ = <-sub.Channel()
Do I get a notification on the channel when a key expires
when i call s.FastForward(x) in my tests
(in go-redis everything works as expected)
thanks for your time
Hi,
thanks for your issue.
sub := client.PSubscribe("keyspace@0:" + key)
miniredis doesn't have support for that currently. I'll have a look soon-ish.
Found the docs: https://redis.io/topics/notifications
yes, there is no support for that right now. Doesn't seem impossible to add, but it's a lot of events. Which events are you most interested in? Mostly the x (expired) events?
For now I would be fine with the expired events. ^^
@alicebob Is this in pipeline, I'd like to contribute if not.
On Sat, May 29, 2021 at 02:04:23AM -0700, Ankit Prakash wrote:
@alicebob Is this in pipeline, I'd like to contribute if not.
I'm not working on it, so a PR would be appreciated!
has there been any progress on this? I'm also looking to use a feature like this in my tests as I use redis to subscribe to expired events
On Mon, Jan 15, 2024 at 10:49:39AM -0800, walkerobrien wrote:
has there been any progress on this? I'm also looking to use a feature like this in my tests as I use redis to subscribe to expired events
Hi, no, no progress. It's a big change and no-one needed badly enough yet to start with it :)