miniredis icon indicating copy to clipboard operation
miniredis copied to clipboard

Can't use key space to subscribe update event

Open LaurenceLiZhixin opened this issue 4 years ago • 1 comments

	s, c := setupMiniredis()
	defer s.Close()
	c.ConfigSet("notify-keyspace-events", "KA")
	c.Set("abc", "def", 0)
	p := c.Subscribe("__keyspace@0__:abc") // subscribe key space `abc`
	go func() {
		time.Sleep(time.Second)
		c.Set("abc", "defd", 0) // update value
	}()
	for msg := range p.Channel(){ // block here
		fmt.Println(msg)
	}

I use miniredis to test subscribe logic, and block.

LaurenceLiZhixin avatar Sep 13 '21 08:09 LaurenceLiZhixin

Miniredis currently does not support the keyspace events. See also #182.

alicebob avatar Sep 14 '21 07:09 alicebob