Skip to content

Commit b5ece76

Browse files
committed
fix: resolve type inference issues in StdioClientTransport
- Add explicit Void type parameter to Mono.defer() call - Chain .then() to Mono.delay() to ensure consistent Mono<Void> return type Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
1 parent f3b0774 commit b5ece76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mcp/src/main/java/io/modelcontextprotocol/client/transport/StdioClientTransport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,14 @@ public Mono<Void> closeGracefully() {
346346
return Mono.fromRunnable(() -> {
347347
isClosing = true;
348348
logger.debug("Initiating graceful shutdown");
349-
}).then(Mono.defer(() -> {
349+
}).then(Mono.<Void>defer(() -> {
350350
// First complete all sinks to stop accepting new messages
351351
inboundSink.tryEmitComplete();
352352
outboundSink.tryEmitComplete();
353353
errorSink.tryEmitComplete();
354354

355355
// Give a short time for any pending messages to be processed
356-
return Mono.delay(Duration.ofMillis(100));
356+
return Mono.delay(Duration.ofMillis(100)).then();
357357
})).then(Mono.defer(() -> {
358358
logger.debug("Sending TERM to process");
359359
if (this.process != null) {

0 commit comments

Comments
 (0)