From 8b53ca2ab0121cdea78fc8ac98d8b68ebe7601be Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 22 Oct 2022 02:30:13 +0200 Subject: [PATCH] Mention duplicate tasks in execute_async() --- src/context.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/context.rs b/src/context.rs index 17ec6b06..4c703392 100644 --- a/src/context.rs +++ b/src/context.rs @@ -53,6 +53,12 @@ pub trait InitContext { pub trait ProcessContext { /// Run a task on a background thread. This allows defering expensive background tasks for /// alter. As long as creating the `task` is realtime-safe, this operation is too. + /// + /// # Note + /// + /// Scheduling the same task multiple times will cause those duplicate tasks to pile up. Try to + /// either prevnt this from happening, or check whether the task still needs to be completed in + /// your task executor. fn execute_async(&self, task: P::BackgroundTask); /// Get the current plugin API.