I'm working on a async Acess Control microservice that uses Casbin and I stumbled upon this issue on redis-watcher.
The main issue arises when the AsyncEnforcer needs to perform asynchronous operations after the watcher is triggered. Currently, since the call towards the watcher's update method is synchronous, it cannot directly call asynchronous functions which are often necessary in an asynchronous environment. E.g. awaiting load_policies.
https://github.com/casbin/pycasbin/blob/e40943447799581bd7a91c9519529979768f1d32/casbin/async_internal_enforcer.py#L148
I'm unsure if maybe there is a specific reason for the current implementation? I am interested in contributing to implementing this feature. Please let me know if a Pull Request for this enhancement would be welcome.
Thanks!
I'm working on a async Acess Control microservice that uses Casbin and I stumbled upon this issue on redis-watcher.
The main issue arises when the
AsyncEnforcerneeds to perform asynchronous operations after the watcher is triggered. Currently, since the call towards the watcher's update method is synchronous, it cannot directly call asynchronous functions which are often necessary in an asynchronous environment. E.g. awaitingload_policies.https://github.com/casbin/pycasbin/blob/e40943447799581bd7a91c9519529979768f1d32/casbin/async_internal_enforcer.py#L148
I'm unsure if maybe there is a specific reason for the current implementation? I am interested in contributing to implementing this feature. Please let me know if a Pull Request for this enhancement would be welcome.
Thanks!