Gracefully shut down the plugin subprocess.
(&self)
| 405 | |
| 406 | /// Gracefully shut down the plugin subprocess. |
| 407 | pub async fn shutdown(&self) -> Result<(), PluginSubprocessError> { |
| 408 | let _: Value = self.call("shutdown", None).await?; |
| 409 | // Give the process a moment to exit, then kill if needed |
| 410 | let mut proc = self.process.lock().await; |
| 411 | let _ = tokio::time::timeout(Duration::from_secs(2), proc.wait()).await; |
| 412 | let _ = proc.kill().await; |
| 413 | Ok(()) |
| 414 | } |
| 415 | |
| 416 | // -- Transport (Content-Length framing) ---------------------------------- |
| 417 |