feat: add local feature for !Send tool handler support (#740)
* feat: add local feature for !Send tool handler support * fix: gate streamable HTTP transport on not(local) feature
This commit is contained in:
parent
8700e5c920
commit
1a4a52a173
3 changed files with 362 additions and 222 deletions
|
|
@ -162,7 +162,8 @@ impl<S: Service<RoleClient>> ServiceExt<RoleClient> for S {
|
|||
self,
|
||||
transport: T,
|
||||
ct: CancellationToken,
|
||||
) -> impl Future<Output = Result<RunningService<RoleClient, Self>, ClientInitializeError>> + Send
|
||||
) -> impl Future<Output = Result<RunningService<RoleClient, Self>, ClientInitializeError>>
|
||||
+ MaybeSendFuture
|
||||
where
|
||||
T: IntoTransport<RoleClient, E, A>,
|
||||
E: std::error::Error + Send + Sync + 'static,
|
||||
|
|
|
|||
|
|
@ -95,7 +95,8 @@ impl<S: Service<RoleServer>> ServiceExt<RoleServer> for S {
|
|||
self,
|
||||
transport: T,
|
||||
ct: CancellationToken,
|
||||
) -> impl Future<Output = Result<RunningService<RoleServer, Self>, ServerInitializeError>> + Send
|
||||
) -> impl Future<Output = Result<RunningService<RoleServer, Self>, ServerInitializeError>>
|
||||
+ MaybeSendFuture
|
||||
where
|
||||
T: IntoTransport<RoleServer, E, A>,
|
||||
E: std::error::Error + Send + Sync + 'static,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::{future::poll_fn, marker::PhantomData};
|
|||
use tower_service::Service as TowerService;
|
||||
|
||||
use super::NotificationContext;
|
||||
use crate::service::{RequestContext, Service, ServiceRole};
|
||||
use crate::service::{MaybeSendFuture, RequestContext, Service, ServiceRole};
|
||||
|
||||
pub struct TowerHandler<S, R: ServiceRole> {
|
||||
pub service: S,
|
||||
|
|
@ -44,7 +44,7 @@ where
|
|||
&self,
|
||||
_notification: R::PeerNot,
|
||||
_context: NotificationContext<R>,
|
||||
) -> impl Future<Output = Result<(), crate::ErrorData>> + Send + '_ {
|
||||
) -> impl Future<Output = Result<(), crate::ErrorData>> + MaybeSendFuture + '_ {
|
||||
std::future::ready(Ok(()))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue