public class WebRxStreamableClientTransport extends Object implements McpClientTransport
| Modifier and Type | Class and Description |
|---|---|
static class |
WebRxStreamableClientTransport.Builder
A builder for creating instances of WebSocketClientTransport.
|
| Constructor and Description |
|---|
WebRxStreamableClientTransport(org.noear.solon.net.http.HttpUtilsBuilder webBuilder,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
String endpoint,
WebRxSseClientTransport sseClientTransport) |
| Modifier and Type | Method and Description |
|---|---|
static WebRxStreamableClientTransport.Builder |
builder(org.noear.solon.net.http.HttpUtilsBuilder webBuilder)
Creates a new instance of StreamableHttpClientTransport using the provided HttpUtilsBuilder.
|
reactor.core.publisher.Mono<Void> |
closeGracefully()
Closes the transport connection and releases any associated resources
asynchronously.
|
reactor.core.publisher.Mono<Void> |
connect(Function<reactor.core.publisher.Mono<McpSchema.JSONRPCMessage>,reactor.core.publisher.Mono<McpSchema.JSONRPCMessage>> handler) |
reactor.core.publisher.Mono<Void> |
sendMessage(McpSchema.JSONRPCMessage message)
Sends a message to the peer asynchronously.
|
reactor.core.publisher.Mono<Void> |
sendMessage(McpSchema.JSONRPCMessage message,
Function<reactor.core.publisher.Mono<McpSchema.JSONRPCMessage>,reactor.core.publisher.Mono<McpSchema.JSONRPCMessage>> handler) |
<T> T |
unmarshalFrom(Object data,
com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
Unmarshals the given data into an object of the specified type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic WebRxStreamableClientTransport(org.noear.solon.net.http.HttpUtilsBuilder webBuilder,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
String endpoint,
WebRxSseClientTransport sseClientTransport)
public static WebRxStreamableClientTransport.Builder builder(org.noear.solon.net.http.HttpUtilsBuilder webBuilder)
webBuilder - the HttpUtilsBuilder to use for building HTTP requestspublic reactor.core.publisher.Mono<Void> connect(Function<reactor.core.publisher.Mono<McpSchema.JSONRPCMessage>,reactor.core.publisher.Mono<McpSchema.JSONRPCMessage>> handler)
connect in interface McpClientTransportpublic reactor.core.publisher.Mono<Void> sendMessage(McpSchema.JSONRPCMessage message)
McpTransportThis method handles the transmission of messages to the server in an asynchronous manner. Messages are sent in JSON-RPC format as specified by the MCP protocol.
sendMessage in interface McpTransportmessage - the McpSchema.JSONRPCMessage to be sent to the serverMono that completes when the message has been sentpublic reactor.core.publisher.Mono<Void> sendMessage(McpSchema.JSONRPCMessage message, Function<reactor.core.publisher.Mono<McpSchema.JSONRPCMessage>,reactor.core.publisher.Mono<McpSchema.JSONRPCMessage>> handler)
public reactor.core.publisher.Mono<Void> closeGracefully()
McpTransportcloseGracefully in interface McpTransportMono that completes when the connection has been closed.public <T> T unmarshalFrom(Object data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
McpTransportunmarshalFrom in interface McpTransportT - the type of the object to unmarshaldata - the data to unmarshaltypeRef - the type reference for the object to unmarshalCopyright © 2025. All rights reserved.