diff options
| author | 2020-06-29 19:15:43 -0700 | |
|---|---|---|
| committer | 2020-06-29 19:15:43 -0700 | |
| commit | c641f7fbbebd4c4c18539c32eb3d3907c8e71dee (patch) | |
| tree | e53bd89584982a10985adf03d529b43cd628e08d | |
| parent | Scheduler: add details to class docstring (diff) | |
Scheduler: explain the name param in the docstring
| -rw-r--r-- | bot/utils/scheduling.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/utils/scheduling.py b/bot/utils/scheduling.py index fc453f19e..0987c5de8 100644 --- a/bot/utils/scheduling.py +++ b/bot/utils/scheduling.py @@ -11,6 +11,10 @@ class Scheduler: """ Schedule the execution of coroutines and keep track of them. + When instantiating a Scheduler, a name must be provided. This name is used to distinguish the + instance's log messages from other instances. Using the name of the class or module containing + the instance is suggested. + Coroutines can be scheduled immediately with `schedule` or in the future with `schedule_at` or `schedule_later`. A unique ID is required to be given in order to keep track of the resulting Tasks. Any scheduled task can be cancelled prematurely using `cancel` by providing |