mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
rpcclient: add close connection function
This commit is contained in:
@@ -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<Value> {
|
||||
let req_id = value.id.clone().as_u64().unwrap_or(0);
|
||||
let value = json!(value);
|
||||
|
||||
Reference in New Issue
Block a user