Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: Support batch enforce and add corresponding test. #274

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

AsakusaRinne
Copy link
Contributor

@AsakusaRinne AsakusaRinne commented Aug 4, 2022

Support batch enforce and add corresponding test. #166

It used async stream to implement BatchEnforceAsync except NET452.

It added BatchEnforceParallel in Enforcer without a corresponding interface in IEnforcer. I'm not sure about the design here. What I think is that its only a special implementation so that adding it to IEnforcer may mean little.

As for the extension, I only provide methods which accept generic type inherited from IRequestValues. The reason is that if I provide similar API with that of EnforceExtension.GenericEnforce, users need to pass several IEnumerable, such as e.BatchEnforce(List<T1>, List<T2>, List<T3>). Thus, consistency of the parameters is not actually ensured, which I think may not be a good practice. Please give some suggestions about it.

I'll PR a benchmark of it if the design is approved finally.

@casbin-bot
Copy link
Member

@sagilio please review

@casbin-bot casbin-bot requested a review from sagilio August 4, 2022 04:39
Copy link
Member

@sagilio sagilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hsluoyz
Copy link
Member

hsluoyz commented Aug 29, 2022

@AsakusaRinne fix:

image

@hsluoyz
Copy link
Member

hsluoyz commented Aug 29, 2022

@AsakusaRinne
image

@hsluoyz hsluoyz merged commit ac0d6de into casbin:preview Aug 29, 2022
@github-actions
Copy link

github-actions bot commented Jan 6, 2023

🎉 This PR is included in version 2.0.0-preview.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@sagilio sagilio self-assigned this Sep 29, 2024
@sagilio sagilio linked an issue Sep 29, 2024 that may be closed by this pull request
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add BatchEnforce and BatchEnforceWithMatcher APIs Parallel enforcing feature
4 participants