Skip to content

Commit 80c88a5

Browse files
committed
Implement retrieve(key) and retrieve(key, :Supplier<CompletableFuture<T>>) operations in Cache.
Closes spring-projects#2650
1 parent 12bfaa5 commit 80c88a5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/org/springframework/data/redis/cache/RedisCache.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import java.util.Map.Entry;
2525
import java.util.StringJoiner;
2626
import java.util.concurrent.Callable;
27+
import java.util.concurrent.CompletableFuture;
28+
import java.util.function.Supplier;
2729

2830
import org.springframework.cache.Cache;
2931
import org.springframework.cache.support.AbstractValueAdaptingCache;
@@ -281,6 +283,16 @@ protected Object preProcessCacheValue(@Nullable Object value) {
281283
return value != null ? value : isAllowNullValues() ? NullValue.INSTANCE : null;
282284
}
283285

286+
@Override
287+
public CompletableFuture<?> retrieve(Object key) {
288+
return super.retrieve(key);
289+
}
290+
291+
@Override
292+
public <T> CompletableFuture<T> retrieve(Object key, Supplier<CompletableFuture<T>> valueLoader) {
293+
return super.retrieve(key, valueLoader);
294+
}
295+
284296
/**
285297
* Serialize the given {@link String cache key}.
286298
*

0 commit comments

Comments
 (0)