1
0
Fork 0

Mention duplicate tasks in execute_async()

This commit is contained in:
Robbert van der Helm 2022-10-22 02:30:13 +02:00
parent 5ea2377c18
commit 8b53ca2ab0

View file

@ -53,6 +53,12 @@ pub trait InitContext<P: Plugin> {
pub trait ProcessContext<P: Plugin> {
/// 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.