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

Make effector a stream to optimize enforcing speed by quick return #125

Closed
GopherJ opened this issue Apr 25, 2020 · 5 comments
Closed

Make effector a stream to optimize enforcing speed by quick return #125

GopherJ opened this issue Apr 25, 2020 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@GopherJ
Copy link
Member

GopherJ commented Apr 25, 2020

See also: casbin/casbin#439

My idea is to make effector a writable stream (Sink + Stream), once a policy has been analyzed, we write it into the stream and the stream will use different strategy to analyze the result.

Once the final result is produced, we return it as the result of e.enforce

@GopherJ
Copy link
Member Author

GopherJ commented Apr 25, 2020

Or maybe we should just implement it in enforce method?

@GopherJ GopherJ changed the title Make effector a stream to optimize enforcing speed. Make effector a stream to optimize enforcing speed by quick return Apr 25, 2020
@GopherJ
Copy link
Member Author

GopherJ commented Apr 25, 2020

The former makes it more general but harder to implement. The latter is simpler but less general (we need to put everything in enforce method, now it's ok we have only 4 effect strategies but how about having more?)

@hsluoyz
Copy link
Member

hsluoyz commented May 4, 2020

We should extract the effector out. I think the idea about stream sounds good. Is sink + stream a built-in concept/operation in Rust?

@GopherJ
Copy link
Member Author

GopherJ commented May 4, 2020

@hsluoyz It's not a built in concept but pretty common. I didn't try to implement it because some potential problems need to be resolved but generally it should be feasible.

@GopherJ GopherJ added this to the v1.0.0 milestone May 9, 2020
@GopherJ GopherJ added the enhancement New feature or request label May 9, 2020
@GopherJ
Copy link
Member Author

GopherJ commented May 11, 2020

implemented in #142

@GopherJ GopherJ closed this as completed May 11, 2020
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
None yet
Development

No branches or pull requests

2 participants