diff --git a/src/rpc/rpcclient.rs b/src/rpc/rpcclient.rs index 05fdbae1e..f10d9e11f 100644 --- a/src/rpc/rpcclient.rs +++ b/src/rpc/rpcclient.rs @@ -18,6 +18,11 @@ impl RpcClient { Ok(Self { sender, receiver, stop_signal }) } + pub async fn close(&self) -> Result<()> { + self.stop_signal.send(()).await?; + Ok(()) + } + pub async fn request(&self, value: JsonRequest) -> Result { let req_id = value.id.clone().as_u64().unwrap_or(0); let value = json!(value);