Skip to content

AsyncEnforcer doesn't support async calls for Watcher's update function #340

@tanasecucliciu

Description

@tanasecucliciu

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!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions