-
Notifications
You must be signed in to change notification settings - Fork 185
Debug and doc fixes #451
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
Debug and doc fixes #451
Conversation
bikeshedder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot.
crates/deadpool/src/managed/pool.rs
Outdated
| slots: Mutex<Slots<ObjectInner<M>>>, | ||
| /// Number of ['Pool'] users. A user is both a future which is waiting for an ['Object'] or one | ||
| /// with an ['Object'] which hasn't been returned, yet. | ||
| /// Number of [`Pool`] users. A user is any future that has acquired a semaphore permit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A user is both a future that is waiting for a semaphore permit and a future that has acquired a permit. Essentially the semaphore is the first line of defense to borrow an object from the pool. If a future has acquired a permit it is allowed to either reuse an object stored in the slots vector or create a new one. A future that hasn't acquired a future is considered "waiting".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, "acquired" is incorrect. Let me think more on this one--I'll reword or drop it shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping for now--if I come up with anything better I'll submit it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of this instead?
- /// Number of [`Pool`] users. A user is both a future which is waiting for an [`Object`] or one
- /// with an [`Object`] which hasn't been returned, yet.
+ /// Number of [`Pool`] users. A user is a future, including both those waiting for an [`Object`]
+ /// and those currently holding an [`Object`].
If you like it, I'm happy to add it to this PR or submit it as a followup PR.
Fixes: 9426cce("Fix default pool max size")
|
Thanks a lot! 🥳 |
No description provided.