-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
feature - enabling a time to execution property on Routines #416
base: master
Are you sure you want to change the base?
feature - enabling a time to execution property on Routines #416
Conversation
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.
Whilst I respect this is still in draft, it has some issues already:
time_till_execution
is not proper English, perhaps you'd mean to use next_execution_time
?
There are more in the review steps below.
twitchio/ext/routines/__init__.py
Outdated
|
||
|
||
@property | ||
def time_till_execution(self) -> datetime.timedelta: |
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.
See review comment on this one.
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.
Actually, I'm going back through this and it sort of clicked. The naming of the property could be confusing.
This does expose a next_event_time
. As an aside, that should probably be marked as private.
How would you feel about something like time_until_next_event
? While the docstring and typing should be pretty clear, I figure the naming could also be improved to emphasize that this is a duration estimate.
Have you tested all variations of multiple routines running simultaneously with some being stopped, the execution time being changed mid run, cancelled etc. We also run this with black -l 120 |
Still working through test cases. Happy path for what I need it for seems to be stable with start/stops but it's by no means exhaustive yet. Are there tests in the repo or elsewhere to improve that coverage or at least ensure I'm doing no harm? Copy on the use of black. |
I think the name came from the discord discussion. Will update in next push |
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.
One missed change
The checks are failing due to using 3.10+ Union syntax ( |
f396e88
to
d918338
Compare
a2a1ac1
to
3b017b0
Compare
./test.py is my sort of body of evidence that, yes, I believe that this has now been tested against most use cases (in the hackiest way). It will be removed when this leaves draft, but I wasn't sure how else to prove that. |
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.
Some queries around style choices and whatnot, that's all!
@@ -1,11 +1,12 @@ | |||
:orphan: | |||
orphan: |
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.
Directive should be :orphan:
, no?
|
||
Master | ||
====== | ||
- TwitchIO | ||
- Bug fixes | ||
- Fix IndexError when getting prefix when empty message is sent in a reply. | ||
|
||
- Additioons |
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.
- Additioons | |
- Additions |
@@ -24,6 +25,7 @@ Master | |||
- Added :func:`~twitchio.Client.fetch_content_classification_labels` along with :class:`~twitchio.ContentClassificationLabel` | |||
- Added :attr:`~twitchio.ChannelInfo.content_classification_labels` and :attr:`~twitchio.ChannelInfo.is_branded_content` to :class:`~twitchio.ChannelInfo` | |||
- Added new parameters to :func:`~twitchio.PartialUser.modify_stream` for ``is_branded_content`` and ``content_classification_labels`` | |||
|
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.
Why was this newline added? Did it cause an issue in the building of the documentation?
@@ -211,7 +215,6 @@ def restart_when_over(fut, *, args=args, kwargs=kwargs): | |||
|
|||
if self._can_be_cancelled(): | |||
self._task.add_done_callback(restart_when_over) | |||
|
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.
Why was this newline removed?
There's also a merge conflict that must be resolved be we can merge. |
Pull request summary
Proposed attempt to exposing a "time to next execution" property within Routines
Checklist