Rename CoroutinesUtils#invokeHandlerMethod to invokeSuspendingFunction
This commit is contained in:
parent
2b4eb610a7
commit
9b33b0ad58
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue