Wrap each request in a service scope (#276)
* Wrap each request in a service scope * Change request/notification delegates to return ValueTask * Address feedback
This commit is contained in:
parent
f1cc2d81de
commit
f4c87f5e2f
1 changed files with 477 additions and 306 deletions
|
|
@ -56,4 +56,13 @@ public class McpServerOptions
|
|||
/// to provide context about available functionality.
|
||||
/// </remarks>
|
||||
public string? ServerInstructions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether to create a new service provider scope for each handled request.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The default is <see langword="true"/>. When <see langword="true"/>, each invocation of a request
|
||||
/// handler will be invoked within a new service scope.
|
||||
/// </remarks>
|
||||
public bool ScopeRequests { get; set; } = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue