Arnaud.
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/DX8d-IqR4RUJ.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
There is no current way, but at least one request for notifications.
> I don't think that Redis can push the value of a counter directly to
> clients.
> That's why, I'm thinking about publishing a notification on a channel (the
> channel is the key name) so clients will receive a notification and query
> Redis to get the value.
>
> Is that the right way to do it?
That will work. Alternatively, if you want to go a bit over the top,
you could use MONITOR and build a system that automatically broadcasts
updates when certain operations are performed. With such a system, any
client that is updating data doesn't need to be updated to also
publish information.
Here's a quick hack that will publish the name of a key being
incremented to a channel of the same name for INCR operations.
redis-cli monitor | sed -e 's/"//g;s/(db ..*)//g' | grep INCR | awk
'{print "publish", $3, $3}' | redis-cli
It doesn't really support multiple databases, as it discards database
information and posts publish information into DB 0, but adding that
functionality shouldn't be that bad.
Regards,
- Josiah