You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asyncband.apache.org by "nanami-0713 (via GitHub)" <gi...@apache.org> on 2026/10/14 14:24:19 UTC
[I] Consider a `# Usage` guidance section for `Semaphore` [asyncband]
nanami-0713 opened a new issue, #372:
URL: https://github.com/apache/asyncband/issues/372
## Observation
The two event primitives carry `# Usage` sections on their type docs (`ManualResetEvent` since v0.7.0, `AutoResetEvent` since v0.7.3) that say when the primitive is the right tool and call out the sharp edges in plain terms.
No other primitive in the crate has such a section today. `Semaphore` looks like the most valuable place to spread the convention next: its module docs summarize the three entry points and show an example, but leave the choosing and the sharp edges to the reader.
## Topics a `# Usage` section could cover
- When to reach for a semaphore versus the signaling primitives: limiting concurrent work by counting, versus signaling readiness.
- Acquiring more permits than the semaphore can currently grant, and what a large pending acquisition means for smaller ones queued behind it.
- The difference between `drain_permits` (takes up to the requested number of available permits) and `reduce_permits` (takes exactly that many, consuming future releases).
- What happens to a pending acquisition, and the permits already assigned to it, when the caller stops waiting.
## Question
Is the `# Usage` section a convention the project wants across its primitives? If yes, I am happy to draft the `Semaphore` section for review, or this can guide a first contribution once the content is agreed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org
Re: [I] Consider a `# Usage` guidance section for `Semaphore` [asyncband]
Posted by "nanami-0713 (via GitHub)" <gi...@apache.org>.
nanami-0713 commented on issue #372:
URL: https://github.com/apache/asyncband/issues/372#issuecomment-6170973244
OK, I'll follow up with a pull request drafting the section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org
Re: [I] Consider a `# Usage` guidance section for `Semaphore` [asyncband]
Posted by "nanami-0713 (via GitHub)" <gi...@apache.org>.
nanami-0713 commented on issue #372:
URL: https://github.com/apache/asyncband/issues/372#issuecomment-6172160290
Resolved: the comparison content belongs on the website blog rather than in API docs; following up at apache/asyncband-site.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org
Re: [I] Consider a `# Usage` guidance section for `Semaphore` [asyncband]
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #372:
URL: https://github.com/apache/asyncband/issues/372#issuecomment-6170900714
I have to admit I don't read the details, but generally, for this kind of suggestion, I would like to see a pull request so I can preview the final documents locally and decide whether to accept the change.
We don't need to discuss this abstractly in an issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org
Re: [I] Consider a `# Usage` guidance section for `Semaphore` [asyncband]
Posted by "nanami-0713 (via GitHub)" <gi...@apache.org>.
nanami-0713 closed issue #372: Consider a `# Usage` guidance section for `Semaphore`
URL: https://github.com/apache/asyncband/issues/372
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org