Redis timeout expired key monitoring trigger

Redis key invalidation removal event listener

 

1.  Events are distributed through the subscription and publishing function (pub/sub) of Redis, so it is necessary to subscribe

See  __keyevent@0__:expired channel

0 means db0 selects the appropriate number according to its own dbindex

 

2. Modify  the redis.conf  file 

Modify notify-keyspace-events  Ex 

 

3. Restart redis, you can test the trigger of the failure event, and the value obtained by listening is the key

 

doc reference:  http://redis.readthedocs.org/en/latest/topic/notification.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326588920&siteId=291194637