-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement Base.isempty(::RemoteChannel) #107
Implement Base.isempty(::RemoteChannel) #107
Conversation
The default method from Base has the nasty side-effect of take!()'ing from the underlying channel.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #107 +/- ##
==========================================
+ Coverage 79.16% 79.18% +0.02%
==========================================
Files 10 10
Lines 1896 1898 +2
==========================================
+ Hits 1501 1503 +2
Misses 395 395 ☔ View full report in Codecov by Sentry. |
(bump) |
3 similar comments
(bump) |
(bump) |
(bump) |
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.
This also makes isempty
return true instead of hanging when the channel is empty.
Huh? julia> using Distributed
julia> addprocs(1)
1-element Vector{Int64}:
2
julia> x = RemoteChannel()
RemoteChannel{Channel{Any}}(1, 1, 3)
julia> remotecall_fetch(isempty, 2, x)
true |
Huh. That's weird. Screencast.from.2024-11-16.16-29-17.webm |
And when I interrupt
|
To clarify, in my code snippet I started Julia with |
I miss spoke. It correctly returns true when the collection is empty. |
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.
LGTM
@JamesWrigley I have invited you to have commit access to the repo. Thanks for the PRs! |
Cool, thanks :) |
The default method from Base has the nasty side-effect of take!()'ing from the underlying channel.