casbin / jcasbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Java
https://casbin.org
Apache License 2.0
2.4k stars 464 forks source link

update our watchers to support the new Watcher interface #206

Closed hsluoyz closed 3 years ago

hsluoyz commented 3 years ago

https://github.com/casbin/jcasbin/issues/201#issuecomment-864574337

hsluoyz commented 3 years ago

@shink

shink commented 3 years ago

@hsluoyz OK, I will.

rongfengliang commented 3 years ago

@shink add void setUpdateCallback(Consumer func); in Watcher interface as one default implement maybe better

like this

 default void setUpdateCallback(Consumer<String> func) {};

so any watcher library deps jcasbin nee't rewrite .just upgrade version if one want implement callback with args just override it

shink commented 3 years ago

@rongfengliang Yes, it's a good idea. But if the user calls this method and finds it blank, it may be misleading. We should remind the user to implement it. (There may exist third-party watchers.) @hsluoyz What do you think?

rongfengliang commented 3 years ago

@shink for default method implement . we can show some log message contains how to implement it

shink commented 3 years ago

@rongfengliang It's a good idea! Thank you for your suggestion.

hsluoyz commented 3 years ago

Moved to: https://github.com/jcasbin/redis-watcher/issues/10