Polishing

This commit is contained in:
Sébastien Deleuze
2025-09-17 15:17:23 +02:00
parent da0a36bfd6
commit 23d1b0e881
@@ -37,6 +37,7 @@ import kotlin.reflect.full.KClasses;
import kotlin.reflect.jvm.KCallablesJvm;
import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jspecify.annotations.Nullable;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
import reactor.core.publisher.SynchronousSink;
import reactor.core.scheduler.Scheduler;
@@ -332,7 +333,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
if (isSuspendingFunction) {
Object coroutineContext = exchange.getAttribute(COROUTINE_CONTEXT_ATTRIBUTE);
Object result = (coroutineContext == null ? CoroutinesUtils.invokeSuspendingFunction(method, target, args) :
Publisher<?> result = (coroutineContext == null ? CoroutinesUtils.invokeSuspendingFunction(method, target, args) :
CoroutinesUtils.invokeSuspendingFunction((CoroutineContext) coroutineContext, method, target, args));
return (result instanceof Mono<?> mono ? mono.handle(KotlinDelegate::handleResult) : result);
}