com.github.anicolaspp.Hx.commands.SingleCommand 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.netflix.hystrix.HystrixCommand;
class SingleCommand extends HystrixCommand {
private final BreakerSupplier supplier;
SingleCommand(BreakerSupplier supplier, Setter setter) {
super(setter);
this.supplier = supplier;
}
@Override
protected Result run() throws Exception {
return supplier.get();
}
}