add watch

This commit is contained in:
2026-05-13 00:41:26 +09:00
parent cde37d516b
commit 4e515ba964
13 changed files with 336 additions and 64 deletions

View File

@@ -127,6 +127,9 @@ impl AuthedClient {
_ => {}
}
}
// Signal all pending callers that the connection is gone.
pending_r.lock().await.clear();
*events_tx_r.lock().await = None;
});
Ok(Self {
@@ -147,7 +150,7 @@ impl AuthedClient {
.send(OpMsg::Req { id, body })
.await
.map_err(|_| anyhow!("send failed (connection closed)"))?;
rx.await.map_err(|_| anyhow!("response dropped"))
rx.await.map_err(|_| anyhow!("backend disconnected"))
}
pub async fn req_stream(&self, body: OpReq) -> Result<(u64, mpsc::Receiver<OpResp>)> {