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>
This commit is contained in:
Christian Tzolov 2025-06-17 17:21:34 +02:00
commit b5ece766e7

View file

@ -346,14 +346,14 @@ public class StdioClientTransport implements McpClientTransport {
return Mono.fromRunnable(() -> {
isClosing = true;
logger.debug("Initiating graceful shutdown");
}).then(Mono.defer(() -> {
}).then(Mono.<Void>defer(() -> {
// First complete all sinks to stop accepting new messages
inboundSink.tryEmitComplete();
outboundSink.tryEmitComplete();
errorSink.tryEmitComplete();
// Give a short time for any pending messages to be processed
return Mono.delay(Duration.ofMillis(100));
return Mono.delay(Duration.ofMillis(100)).then();
})).then(Mono.defer(() -> {
logger.debug("Sending TERM to process");
if (this.process != null) {