CONNECTION
- the resource on which the stream is being served and consumed via
this mechanismpublic interface McpTransportStream<CONNECTION>
限定符和类型 | 方法和说明 |
---|---|
org.reactivestreams.Publisher<McpSchema.JSONRPCMessage> |
consumeSseStream(org.reactivestreams.Publisher<reactor.util.function.Tuple2<java.util.Optional<java.lang.String>,java.lang.Iterable<McpSchema.JSONRPCMessage>>> eventStream)
Allows keeping track of the transport stream of events (currently an SSE stream
from Streamable HTTP specification) and enable resumability and reconnects in case
of stream errors.
|
java.util.Optional<java.lang.String> |
lastId()
The last observed event identifier.
|
long |
streamId()
An internal stream identifier used to distinguish streams while debugging.
|
java.util.Optional<java.lang.String> lastId()
long streamId()
long
stream identifier valueorg.reactivestreams.Publisher<McpSchema.JSONRPCMessage> consumeSseStream(org.reactivestreams.Publisher<reactor.util.function.Tuple2<java.util.Optional<java.lang.String>,java.lang.Iterable<McpSchema.JSONRPCMessage>>> eventStream)
eventStream
- a Publisher
of tuples (pairs) of an optional identifier
associated with a collection of messagesPublisher
of
JSON-RPC messages
with the identifier stripped away