diff --git a/plugins/src/lib.rs b/plugins/src/lib.rs index a34115a29..e6c584ce8 100644 --- a/plugins/src/lib.rs +++ b/plugins/src/lib.rs @@ -691,6 +691,7 @@ impl Plugin where S: Send + Clone, { + /// Wait for plugin shutdown pub async fn join(&self) -> Result<(), Error> { self.wait_handle .subscribe() @@ -698,6 +699,14 @@ where .await .context("error waiting for shutdown") } + + /// Request plugin shutdown + pub fn shutdown(&self) -> Result<(), Error> { + self.wait_handle + .send(()) + .context("error waiting for shutdown")?; + Ok(()) + } } #[cfg(test)]