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

Support acquire_many (and variants) in Semaphore #24

Open
afranchuk opened this issue May 13, 2022 · 0 comments
Open

Support acquire_many (and variants) in Semaphore #24

afranchuk opened this issue May 13, 2022 · 0 comments

Comments

@afranchuk
Copy link

It'd be great if Semaphore supported _many variants for acquisition. To guarantee fairness, Event would need to change (as you'd need to check whether there are enough permits for the head of the listener list and only notify if that were the case). If interested, I have a set of changes for event-listener which I think does the trick (adding a new CondEvent type which allows data to be associated with listeners and a predicate over that data to be passed with notify). I also have another set of changes for async-lock which allow multiple permits to be acquired (I haven't fully tested them together, but will do so if this sounds like a good idea to you). Thanks!

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

No branches or pull requests

1 participant