Fix and enhance cancellation operations across MCP Sessions. (#179)
* Propagate CancellationToken request cancellation to remote endpoint * Refactor existing tests to have a shared base class * Add cancellation tests --------- Co-authored-by: Stephen Toub <stoub@microsoft.com>
This commit is contained in:
parent
4dd2f42b82
commit
03e3094dcc
1 changed files with 334 additions and 336 deletions
|
|
@ -155,14 +155,14 @@ public static class McpEndpointExtensions
|
|||
{
|
||||
Throw.IfNull(endpoint);
|
||||
|
||||
return endpoint.SendMessageAsync(new JsonRpcNotification()
|
||||
{
|
||||
Method = NotificationMethods.ProgressNotification,
|
||||
Params = JsonSerializer.SerializeToNode(new ProgressNotification
|
||||
return endpoint.SendNotificationAsync(
|
||||
NotificationMethods.ProgressNotification,
|
||||
new ProgressNotification
|
||||
{
|
||||
ProgressToken = progressToken,
|
||||
Progress = progress,
|
||||
}, McpJsonUtilities.JsonContext.Default.ProgressNotification),
|
||||
}, cancellationToken);
|
||||
},
|
||||
McpJsonUtilities.JsonContext.Default.ProgressNotification,
|
||||
cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue