Skip to content

Conversation

@dgw
Copy link
Member

@dgw dgw commented Jan 29, 2023

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

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

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_registered is any more because it's private now. We can do whatever we want to it.

So I decided to make it a threading.Event object in 8.0, making the "big" change (data type) now to open the road for new API features in 8.1. I picture something like bot.wait_for_registration(timeout=None), but workshopping that and other ideas is best left for another day (after 8.0 is released).

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.
@dgw dgw added the Tweak label Jan 29, 2023
@dgw dgw added this to the 8.0.0 milestone Jan 29, 2023
@dgw dgw requested a review from a team January 29, 2023 18:56
@dgw dgw linked an issue Jan 29, 2023 that may be closed by this pull request
@dgw dgw merged commit 778cf79 into master Feb 17, 2023
@dgw dgw deleted the connection_registered_event branch February 17, 2023 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bot: threading.Event instead of Boolean for _connection_registered

3 participants