Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tanasecucliciu opened this issue Jan 28, 2024 · 4 comments · Fixed by #341
Closed

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

tanasecucliciu opened this issue Jan 28, 2024 · 4 comments · Fixed by #341
Assignees
Labels
enhancement New feature or request

Comments

@tanasecucliciu
Copy link
Contributor

tanasecucliciu commented Jan 28, 2024

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.

self.watcher.update_for_add_policies(sec, ptype, rules)

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!

@casbin-bot
Copy link
Member

@techoner @Nekotoxin

@casbin-bot casbin-bot added the enhancement New feature or request label Jan 28, 2024
@leeqvip
Copy link
Member

leeqvip commented Jan 29, 2024

@tanasecucliciu Hi, We really need your PR.

@hsluoyz
Copy link
Member

hsluoyz commented Jan 29, 2024

@tanasecucliciu can you make a PR?

@tanasecucliciu
Copy link
Contributor Author

@hsluoyz Sure thing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

4 participants