com.github.phantomthief.failover.impl.WeightFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-failover Show documentation
Show all versions of simple-failover Show documentation
A simple failover library for Java
package com.github.phantomthief.failover.impl;
/**
* @author huangli
* Created on 2020-01-16
*/
public interface WeightFunction {
double success(double maxWeight, double minWeight, int priority, double currentOldWeight, T resource);
double fail(double maxWeight, double minWeight, int priority, double currentOldWeight, T resource);
boolean needCheck(double maxWeight, double minWeight, int priority, double currentWeight, T resource);
}