Skip to content

Conversation

@sarsko
Copy link
Contributor

@sarsko sarsko commented Apr 18, 2025

Adds BatchSemaphore::{held_permits, is_queued}. The motivation is so that functionality building atop BatchSemaphore can protect against things like reentrancy or double_queueing.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

smallvec = { version = "1.11.2", features = ["const_new"] }
tracing = { version = "0.1.36", default-features = false, features = ["std"] }
corosensei = "0.3.1"
indexmap = { version = "2.9", features = ["std"] }
Copy link
Member

Choose a reason for hiding this comment

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

Curious why we need to add a dependency on IndexMap here? Why isn't HashMap good enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did it to not have a latent footgun. HashMap does not have deterministic iteration order, but IndexMap does.

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

Successfully merging this pull request may close these issues.

2 participants