首页   API文档   注册   登录
Casbin = way to authorization
A place for Casbin developers and users
现在注册
已注册用户请  登录
SiggiSmara
Casnode  ›  Casbin

Watcher vs SyncedEnforcer

  •  
  •  
    SiggiSmara · 2个月前 · 176 次点击 
    这是一个创建于 70 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Hello everyone,

    I was wondering if you can give me advice on when to use a Watcher versus a SyncedEnforcer.

    My use case is a fastAPI REST service that spawns several workers, so using pycasbin library. No large volume of request and infrequent changes to policies. Policies are persited in a database using casbin_sqlalchemy_adapter.

    Until now I have been using SyncedEnforcer and that seems to work fine for what I need. Then I started reading about Watchers and was wondering what the real difference between the two is given that they are both taking care of synchronizing policy changes.

    Do I understand it correctly that a SyncedEnforcer is actively checking for updates (pull updates from db) while with a Watcher the Enforcers are subscribing to events (changes are pushed to enforcers)? And that in high volume setups the Watcher might be more performant? Or is there some other benefit of Watchers that I am missing?

    176 次点击  ∙  1 人收藏  
    Tweet Weibo 忽略主题 
    2 条回复   2021-09-05T15:49:57+08:00
    hsluoyz
    1
    hsluoyz2个月前

    @SiggiSmara hi, plz send github issue

    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   0 人在线   最高记录 30   ·     选择语言  ·     选择编辑器
    创意工作者们的社区
    World is powered by code
    VERSION: b315f58 · 1ms · UTC 21:51 · PVG 05:51 · LAX 14:51 · JFK 17:51
    ♥ Do have faith in what you're doing.