Closed ccppoo closed 2 years ago
Hello! Thanks for the issue. If this is a general help question, for a faster response consider joining the official Discord Server
Else if you have an issue with the library please wait for someone to help you here.
The type hint shows if it takes a value it has to be a bool so it is not ambiguous as to whether it could be an int or a float.
The argument name of wait_first
implies the question "Would you like to wait first before the first iteration", where specified time is the routine loop interval.
The docs can be updated to reflect this better.
The wait_for
proposal is basically the already existing @before.routine method, where you can simply perform a task and then asyncio.sleep() before the main body executes.
@chillymosh I haven't thought using @before.routine
thanks ,my bad
Just for someone else like me
Closing as not an issue.
Current explanation about
wait_first
in doc is ambiguous.https://github.com/TwitchIO/TwitchIO/blob/14b0880d9c22f6fc599f23ddbcb08e1aa8c962c4/twitchio/ext/routines/__init__.py#L364-L366
It says it waits for specific time so, this could be understood as it's requiring
int
orfloat
.https://github.com/TwitchIO/TwitchIO/blob/14b0880d9c22f6fc599f23ddbcb08e1aa8c962c4/twitchio/ext/routines/__init__.py#L390-L407
But it actually waits for time to wait before the next iteration of the routine. ↑
https://github.com/TwitchIO/TwitchIO/blob/14b0880d9c22f6fc599f23ddbcb08e1aa8c962c4/twitchio/ext/routines/__init__.py#L288-L289
delta
passed toRoutine
is used wait for next iteration as the code shows ↑proposal
add
wait_for
keyword parameter requiringint
orfloat
to wait for specific timefor example
wait_for
key word will be used for jobs that hastime out
like DB connectionsthat should run first in the place when the app started and then run after every 10 minutes