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

Can't use key space to subscribe update event #222

Open
LaurenceLiZhixin opened this issue Sep 13, 2021 · 1 comment
Open

Can't use key space to subscribe update event #222

LaurenceLiZhixin opened this issue Sep 13, 2021 · 1 comment

Comments

@LaurenceLiZhixin
Copy link

	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.

@alicebob
Copy link
Owner

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

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

No branches or pull requests

2 participants