Add Coroutines support for @Cacheable
This commit adds Coroutines support for `@Cacheable`. It also refines SimpleKeyGenerator to ignore Continuation parameters (Kotlin does not allow to have the same method signature with both suspending and non-suspending variants) and refines org.springframework.aop.framework.CoroutinesUtils.awaitSingleOrNull in order to wrap plain value to Mono. Closes gh-31412
This commit is contained in:
@@ -36,10 +36,11 @@ abstract class CoroutinesUtils {
|
||||
return ReactiveFlowKt.asFlow((Publisher<?>) publisher);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
static Object awaitSingleOrNull(Object mono, Object continuation) {
|
||||
return MonoKt.awaitSingleOrNull((Mono<?>) mono, (Continuation<Object>) continuation);
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
static Object awaitSingleOrNull(Object value, Object continuation) {
|
||||
return MonoKt.awaitSingleOrNull(value instanceof Mono mono ? mono : Mono.just(value),
|
||||
(Continuation<Object>) continuation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user