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

add method total_listeners() when feature std #114

Merged
merged 8 commits into from
Jan 25, 2024
Merged

add method total_listeners() when feature std #114

merged 8 commits into from
Jan 25, 2024

Conversation

beckend
Copy link
Contributor

@beckend beckend commented Jan 16, 2024

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

I think the documentation should be modified with less guarantees as to the effectiveness of this function. For instance, the documentation should mention all of the following:

  • This is just a snapshot of the number of listeners at this point in time. It is possible for the actual number to change at any point.
  • The number should only ever be used as a hint.

src/std.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@beckend
Copy link
Contributor Author

beckend commented Jan 17, 2024

@notgull could you review it again?

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@@ -54,6 +54,14 @@ impl<T> List<T> {
Err(_) => Err("<locked>"),
}
}

// Get the listener count by blocking
pub(crate) fn total_listeners_wait(&self) -> usize {
Copy link
Member

Choose a reason for hiding this comment

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

Name this function total_listeners instead.

Copy link
Contributor Author

@beckend beckend Jan 21, 2024

Choose a reason for hiding this comment

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

total_listeners is already defined just above.

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

Thanks!

@notgull notgull merged commit a68f5ee into smol-rs:master Jan 25, 2024
9 checks passed
@notgull notgull mentioned this pull request Feb 5, 2024
notgull added a commit that referenced this pull request Apr 14, 2024
Mirror of #114

Signed-off-by: John Nunley <dev@notgull.net>
notgull added a commit that referenced this pull request Apr 16, 2024
Mirror of #114

Signed-off-by: John Nunley <dev@notgull.net>
notgull added a commit that referenced this pull request Apr 18, 2024
Mirror of #114

Signed-off-by: John Nunley <dev@notgull.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants