提交 9b33b0ad 编写于 作者: S Sebastien Deleuze

Rename CoroutinesUtils#invokeHandlerMethod to invokeSuspendingFunction

上级 2b4eb610
......@@ -52,15 +52,15 @@ internal fun <T: Any> monoToDeferred(source: Mono<T>) =
GlobalScope.async(Dispatchers.Unconfined) { source.awaitFirstOrNull() }
/**
* Invoke an handler method converting suspending method to [Mono] or
* [reactor.core.publisher.Flux] if necessary.
* Invoke a suspending function converting it to [Mono] or [reactor.core.publisher.Flux]
* if necessary.
*
* @author Sebastien Deleuze
* @since 5.2
*/
@Suppress("UNCHECKED_CAST")
@ExperimentalCoroutinesApi
internal fun invokeHandlerMethod(method: Method, bean: Any, vararg args: Any?): Any? {
internal fun invokeSuspendingFunction(method: Method, bean: Any, vararg args: Any?): Any? {
val function = method.kotlinFunction!!
return if (function.isSuspend) {
val mono = mono(Dispatchers.Unconfined) {
......
......@@ -131,7 +131,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
Method method = getBridgedMethod();
ReflectionUtils.makeAccessible(method);
if (KotlinDetector.isKotlinReflectPresent() && KotlinDetector.isKotlinType(method.getDeclaringClass())) {
value = CoroutinesUtils.invokeHandlerMethod(method, getBean(), args);
value = CoroutinesUtils.invokeSuspendingFunction(method, getBean(), args);
}
else {
value = method.invoke(getBean(), args);
......
......@@ -140,7 +140,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
ReflectionUtils.makeAccessible(getBridgedMethod());
Method method = getBridgedMethod();
if (KotlinDetector.isKotlinReflectPresent() && KotlinDetector.isKotlinType(method.getDeclaringClass())) {
value = CoroutinesUtils.invokeHandlerMethod(method, getBean(), args);
value = CoroutinesUtils.invokeSuspendingFunction(method, getBean(), args);
}
else {
value = method.invoke(getBean(), args);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册