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

acquiring has to be cancellable #10

Open
michaelficarra opened this issue Oct 25, 2024 · 0 comments
Open

acquiring has to be cancellable #10

michaelficarra opened this issue Oct 25, 2024 · 0 comments

Comments

@michaelficarra
Copy link
Member

We thought that this may be the case, but I was really confronted with the need when implementing the summing combinator (any) in #9. The only way we can "race" Governors is to try to acquire all of them and then race the promises. Unfortunately, once we acquire the first one, we can't cancel the other attempts. Instead, we just have to queue up a release once they resolve. This wouldn't be so bad if we were only considering simple counting Governors. But since we want Governors to also be able to implement time-based rate limiting, acquiring and immediately releasing a token is not equivalent to aborting an acquisition attempt (or just never attempting to acquire). So I don't see any way around depending on some kind of cancellation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant