billcobbler / casbin-redis-watcher

Redis watcher for Casbin https://github.com/casbin/casbin
Apache License 2.0
19 stars 23 forks source link

Ignore and squash options #7

Closed rwbarber2 closed 4 years ago

rwbarber2 commented 4 years ago

Given a large number of g records the LoadPolicy() function can take some time. The optimizations in this PR support 2 features:

IgnoreSelf - Incoming redis messages from self will be ignored (the callback will not be made).

SquashMessages - Receive all queued redis messages and make the callback one time (instead of once per message).