Skip to content

Conversation

@werekraken
Copy link
Contributor

No description provided.

Copy link
Collaborator

@bikeshedder bikeshedder left a comment

Choose a reason for hiding this comment

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

Thanks a lot.

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,
Copy link
Collaborator

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".

Copy link
Contributor Author

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.

Copy link
Contributor Author

@werekraken werekraken Oct 29, 2025

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.

Copy link
Contributor Author

@werekraken werekraken Oct 29, 2025

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.

@bikeshedder bikeshedder added documentation Improvements or additions to documentation A-core Area: Core / deadpool labels Oct 29, 2025
@bikeshedder bikeshedder merged commit 8c9a143 into deadpool-rs:main Nov 14, 2025
11 checks passed
@bikeshedder
Copy link
Collaborator

Thanks a lot! 🥳

@werekraken werekraken deleted the fixes branch November 14, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-core Area: Core / deadpool documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants