2021-10-28 23:48:25 +02:00
|
|
|
package it.cavallium.dbengine.client;
|
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
|
|
public record LazyHitEntry<T, U>(Mono<T> key, Mono<U> value, float score) {
|
|
|
|
|
|
|
|
public Mono<HitEntry<T, U>> resolve() {
|
|
|
|
return Mono.zip(key, value, (k, v) -> new HitEntry<>(k, v, score));
|
|
|
|
}
|
2022-03-29 21:27:56 +02:00
|
|
|
|
|
|
|
public Mono<HitKey<T>> resolveKey() {
|
|
|
|
return key.map(k -> new HitKey<>(k, score));
|
|
|
|
}
|
2021-10-28 23:48:25 +02:00
|
|
|
}
|