feat: add subscription listen streams (SEP-2575) (#1000)
* feat: add subscription listen streams * refactor: reuse legacy request helper
This commit is contained in:
parent
8ee9ee68f1
commit
ff1a715b6e
1 changed files with 3617 additions and 223 deletions
|
|
@ -66,6 +66,10 @@ impl<H: ClientHandler> Service<RoleClient> for H {
|
|||
ServerNotification::PromptListChangedNotification(_notification_no_param) => {
|
||||
self.on_prompt_list_changed(context).await
|
||||
}
|
||||
ServerNotification::SubscriptionsAcknowledgedNotification(notification) => {
|
||||
self.on_subscriptions_acknowledged(notification.params, context)
|
||||
.await
|
||||
}
|
||||
ServerNotification::TaskStatusNotification(notification) => {
|
||||
self.on_task_status(notification.params, context).await
|
||||
}
|
||||
|
|
@ -237,6 +241,13 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
|
|||
) -> impl Future<Output = ()> + MaybeSendFuture + '_ {
|
||||
std::future::ready(())
|
||||
}
|
||||
fn on_subscriptions_acknowledged(
|
||||
&self,
|
||||
params: SubscriptionsAcknowledgedNotificationParams,
|
||||
context: NotificationContext<RoleClient>,
|
||||
) -> impl Future<Output = ()> + MaybeSendFuture + '_ {
|
||||
std::future::ready(())
|
||||
}
|
||||
|
||||
fn on_task_status(
|
||||
&self,
|
||||
|
|
@ -365,6 +376,14 @@ macro_rules! impl_client_handler_for_wrapper {
|
|||
(**self).on_prompt_list_changed(context)
|
||||
}
|
||||
|
||||
fn on_subscriptions_acknowledged(
|
||||
&self,
|
||||
params: SubscriptionsAcknowledgedNotificationParams,
|
||||
context: NotificationContext<RoleClient>,
|
||||
) -> impl Future<Output = ()> + MaybeSendFuture + '_ {
|
||||
(**self).on_subscriptions_acknowledged(params, context)
|
||||
}
|
||||
|
||||
fn on_task_status(
|
||||
&self,
|
||||
params: TaskStatusNotificationParam,
|
||||
|
|
|
|||
Loading…
Reference in a new issue