1) "notify-keyspace-events"
2) "xE"
1) "notify-keyspace-events"
2) "xK"
zz null 1 undefined undefined undefined
redis2.subscribe('__keyevent@0__:expired', (x, y, c, v, b) => {
console.log('zz', x, y, c, v, b);
});
1550539085.729667 [0 192.168.0.3:56496] "info"
1550539085.750826 [0 192.168.0.3:56498] "info"
1550539085.751758 [0 192.168.0.3:56498] "set" "test" "12" "EX" "1"
1550539085.751925 [0 192.168.0.3:56498] "set" "test" "12" "EX" "2"
1550539085.752053 [0 192.168.0.3:56498] "subscribe" "__keyevent@0__:expired"
5.0.0
redis-cli monitor
and .subscribe('__keyspace@0__:expire',
and .subscribe('__keyevent@0__:expire',
redis-cli set foo bar
and you should see a notification show in monitor
redis-cli --csv psubscribe '__key*__:*'
redis.subscribe('__keyevent@0__:expired');
redis.on('message', async (channel, message) => {
// Handle event
console.log(channel, message);
});