public static class McpStatelessServerFeatures.Async
extends java.lang.Object
构造器和说明 |
---|
Async(McpSchema.Implementation serverInfo,
McpSchema.ServerCapabilities serverCapabilities,
java.util.List<McpStatelessServerFeatures.AsyncToolSpecification> tools,
java.util.Map<java.lang.String,McpStatelessServerFeatures.AsyncResourceSpecification> resources,
java.util.List<McpSchema.ResourceTemplate> resourceTemplates,
java.util.Map<java.lang.String,McpStatelessServerFeatures.AsyncPromptSpecification> prompts,
java.util.Map<McpSchema.CompleteReference,McpStatelessServerFeatures.AsyncCompletionSpecification> completions,
java.lang.String instructions)
Create an instance and validate the arguments.
|
限定符和类型 | 方法和说明 |
---|---|
static McpStatelessServerFeatures.Async |
fromSync(McpStatelessServerFeatures.Sync syncSpec,
boolean immediateExecution)
Convert a synchronous specification into an asynchronous one and provide
blocking code offloading to prevent accidental blocking of the non-blocking
transport.
|
public Async(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities serverCapabilities, java.util.List<McpStatelessServerFeatures.AsyncToolSpecification> tools, java.util.Map<java.lang.String,McpStatelessServerFeatures.AsyncResourceSpecification> resources, java.util.List<McpSchema.ResourceTemplate> resourceTemplates, java.util.Map<java.lang.String,McpStatelessServerFeatures.AsyncPromptSpecification> prompts, java.util.Map<McpSchema.CompleteReference,McpStatelessServerFeatures.AsyncCompletionSpecification> completions, java.lang.String instructions)
serverInfo
- The server implementation detailsserverCapabilities
- The server capabilitiestools
- The list of tool specificationsresources
- The map of resource specificationsresourceTemplates
- The list of resource templatesprompts
- The map of prompt specificationsinstructions
- The server instructions textpublic static McpStatelessServerFeatures.Async fromSync(McpStatelessServerFeatures.Sync syncSpec, boolean immediateExecution)
syncSpec
- a potentially blocking, synchronous specification.immediateExecution
- when true, do not offload. Do NOT set to true when
using a non-blocking transport.