* Extend progress notification support * Address feedback and fix test --------- Co-authored-by: Stephen Toub <stoub@microsoft.com>
16 lines
596 B
C#
16 lines
596 B
C#
using ModelContextProtocol.Protocol.Messages;
|
|
|
|
namespace ModelContextProtocol;
|
|
|
|
/// <summary>
|
|
/// Provides an <see cref="IProgress{ProgressNotificationValue}"/> tied to a specific progress token and that will issue
|
|
/// progress notifications on the supplied endpoint.
|
|
/// </summary>
|
|
internal sealed class TokenProgress(IMcpEndpoint endpoint, ProgressToken progressToken) : IProgress<ProgressNotificationValue>
|
|
{
|
|
/// <inheritdoc />
|
|
public void Report(ProgressNotificationValue value)
|
|
{
|
|
_ = endpoint.NotifyProgressAsync(progressToken, value, CancellationToken.None);
|
|
}
|
|
}
|