com.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 com.github.anicolaspp.Hx.commands;
import com.github.anicolaspp.Hx.BreakerSupplier;
import com.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;
}
}