irc: use threading.Event for internal _connection_registered flag
#2406
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This will let us add API features that take advantage of the
.wait()method available for Event objects.Shouldn't affect plugin code (internal or third-party) much, if at all, since this is an internal value.
connection_registered(no underscore) is still the name in all released versions of Sopel, anyway. In 8.0 it has become a property that checks multiple pieces of state so the answer returned can be more consistent.Checklist
make qa(runsmake qualityandmake test)Dev impact
Follow-up to #2375, where @Exirel proposed this idea but did not block the merge. I thought about it, opened #2391, and left it for 9.0. Then I thought some more this weekend and realized, it doesn't matter what type
bot._connection_registeredis any more because it's private now. We can do whatever we want to it.So I decided to make it a
threading.Eventobject in 8.0, making the "big" change (data type) now to open the road for new API features in 8.1. I picture something likebot.wait_for_registration(timeout=None), but workshopping that and other ideas is best left for another day (after 8.0 is released).