-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Check channel state on iterate #52981
base: master
Are you sure you want to change the base?
Conversation
Okay that implementation won't work, and a real implementation will have a bunch of atomic and concurrency stuff I don't know enough about to be confident in trying, and won't be confident that I won't create hard-to-detect bugs |
base/channels.jl
Outdated
@@ -619,6 +619,7 @@ function iterate(c::Channel, state=nothing) | |||
end | |||
end | |||
else | |||
check_channel_state(c) |
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.
You could inline this implementation but skip throwing the InvalidStateException
, or perhaps more easily, just delete the isopen
check at the top and let take!
handle everything (as it already implements everything necessary)
0ddfd74
to
3d6a2bd
Compare
Test failures appear to be spurious libgit connection issues. I think this PR is good to go, modulo one decision: This PR's current behaviour is that |
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.
I like the change/fix/clean up here; I've been annoyed before that it always throws when done iterating.
Before, iterate on Channel would return `nothing` when the channel was closed, not checking if it was closed with an error.
dbbd7a4
to
e7d4ada
Compare
Before, iterate on Channel would return
nothing
when the channel was closed, not checking if it was closed with an error.Closes #52974