ACP over MCP server impl (#35196)

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
Agus Zubiaga
2025-07-28 14:14:10 +00:00
committed by GitHub
co-authored by Ben Brandt
parent b02ae771cd
commit c2fc70eef7
20 changed files with 899 additions and 137 deletions
+6 -3
View File
@@ -5,6 +5,8 @@
//! read/write messages and the types from types.rs for serialization/deserialization
//! of messages.
use std::time::Duration;
use anyhow::Result;
use futures::channel::oneshot;
use gpui::AsyncApp;
@@ -98,13 +100,14 @@ impl InitializedContextServerProtocol {
self.inner.request(T::METHOD, params).await
}
pub async fn cancellable_request<T: Request>(
pub async fn request_with<T: Request>(
&self,
params: T::Params,
cancel_rx: oneshot::Receiver<()>,
cancel_rx: Option<oneshot::Receiver<()>>,
timeout: Option<Duration>,
) -> Result<T::Response> {
self.inner
.cancellable_request(T::METHOD, params, cancel_rx)
.request_with(T::METHOD, params, cancel_rx, timeout)
.await
}