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 11:14:10 -03:00 committed by GitHub
parent b02ae771cd
commit c2fc70eef7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 899 additions and 137 deletions

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
}