From 36568bc95c0b6b38ede6fde7adb7d4ee2863235f Mon Sep 17 00:00:00 2001 From: wookie184 Date: Tue, 11 Jun 2024 18:54:42 +0000 Subject: Deploying to docs from @ python-discord/bot-core@c17d29a38019ba05a65f1ba3cafa084d2dd76ec7 🚀 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/output/pydis_core.utils.scheduling.html | 101 ++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 19 deletions(-) (limited to 'main/output/pydis_core.utils.scheduling.html') diff --git a/main/output/pydis_core.utils.scheduling.html b/main/output/pydis_core.utils.scheduling.html index 3eefa9cd..e41fff10 100644 --- a/main/output/pydis_core.utils.scheduling.html +++ b/main/output/pydis_core.utils.scheduling.html @@ -5,10 +5,10 @@ - + scheduling - Pydis Core Latest (11.1.0) - + @@ -72,7 +72,7 @@ Light mode + stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun"> @@ -87,7 +87,7 @@ Dark mode + stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon"> @@ -95,7 +95,7 @@ Auto light/dark mode + stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow"> @@ -105,6 +105,60 @@ + + Auto light/dark, in light mode + + + + + + + + + + + + + + + Auto light/dark, in dark mode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -116,6 +170,8 @@
Hide table of contents sidebar
+Skip to content +
@@ -133,7 +189,8 @@
@@ -374,11 +431,17 @@ Back to top
- +
@@ -388,13 +451,13 @@
-
+

scheduling¶

Generic python scheduler.

-class Scheduler(name)[source]¶
+class Scheduler(name)[source]¶

Bases: object

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 @@ -408,7 +471,7 @@ the same ID used to schedule it.

Any exception raised in a scheduled task is logged when the task is done.

-__contains__(task_id)[source]¶
+__contains__(task_id)[source]¶

Return True if a task with the given task_id is currently scheduled.

Parameters:
@@ -425,7 +488,7 @@ the same ID used to schedule it.

-__init__(name)[source]¶
+__init__(name)[source]¶

Initialize a new Scheduler instance.

Parameters:
@@ -436,7 +499,7 @@ the same ID used to schedule it.

-cancel(task_id)[source]¶
+cancel(task_id)[source]¶

Unschedule the task identified by task_id. Log a warning if the task doesn’t exist.

Parameters:
@@ -450,7 +513,7 @@ the same ID used to schedule it.

-cancel_all()[source]¶
+cancel_all()[source]¶

Unschedule all known tasks.

Return type:
@@ -461,7 +524,7 @@ the same ID used to schedule it.

-schedule(task_id, coroutine)[source]¶
+schedule(task_id, coroutine)[source]¶

Schedule the execution of a coroutine.

If a task with task_id already exists, close coroutine instead of scheduling it. This prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-used elsewhere.

@@ -480,7 +543,7 @@ prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-
-schedule_at(time, task_id, coroutine)[source]¶
+schedule_at(time, task_id, coroutine)[source]¶

Schedule coroutine to be executed at the given time.

If time is timezone aware, then use that timezone to calculate now() when subtracting. If time is naïve, then use UTC.

@@ -503,7 +566,7 @@ prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-
-schedule_later(delay, task_id, coroutine)[source]¶
+schedule_later(delay, task_id, coroutine)[source]¶

Schedule coroutine to be executed after delay seconds.

If a task with task_id already exists, close coroutine instead of scheduling it. This prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-used elsewhere.

@@ -525,7 +588,7 @@ prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-
-create_task(coro, *, suppressed_exceptions=(), event_loop=None, **kwargs)[source]¶
+create_task(coro, *, suppressed_exceptions=(), event_loop=None, **kwargs)[source]¶

Wrapper for creating an asyncio.Task which logs exceptions raised in the task.

If the event_loop kwarg is provided, the task is created from that event loop, otherwise the running loop is used.

@@ -630,7 +693,7 @@ otherwise the running loop is used.

- + \ No newline at end of file -- cgit v1.2.3