Add ModelContextProtocol.Core package (#428)
This commit is contained in:
parent
57458241b9
commit
703b0fe50b
1 changed files with 239 additions and 94 deletions
19
src/ModelContextProtocol.Core/NopProgress.cs
Normal file
19
src/ModelContextProtocol.Core/NopProgress.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
namespace ModelContextProtocol;
|
||||
|
||||
/// <summary>Provides an <see cref="IProgress{ProgressNotificationValue}"/> that's a nop.</summary>
|
||||
internal sealed class NullProgress : IProgress<ProgressNotificationValue>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the singleton instance of the <see cref="NullProgress"/> class that performs no operations when progress is reported.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Use this property when you need to provide an <see cref="IProgress{T}"/> implementation
|
||||
/// but don't need to track or report actual progress.
|
||||
/// </remarks>
|
||||
public static NullProgress Instance { get; } = new();
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Report(ProgressNotificationValue value)
|
||||
{
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue