io.github.anicolaspp.Hx.commands.CacheCommandWithFallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of HxFactory Show documentation
Show all versions of HxFactory Show documentation
Factory library to create and run Hystrix commands with simplicity
package io.github.anicolaspp.Hx.commands;
import io.github.anicolaspp.Hx.BreakerSupplier;
import io.github.anicolaspp.Hx.RequestContextInitializer;
import java.util.function.Supplier;
class CacheCommandWithFallback extends CommandWithFallback implements RequestContextInitializer {
private final String key;
CacheCommandWithFallback(String key, BreakerSupplier supplier,
Supplier fallback,
Setter setter) {
super(supplier, fallback, setter);
this.key = key;
initializeRequestContext();
}
@Override
protected String getCacheKey() {
return key;
}
}