badman-core
Version:
badman-core is the layer what all the badman packages depended,or can be used as a tool kit.
16 lines (15 loc) • 564 B
TypeScript
import WeightValue from "./WeightValue";
export default abstract class AbstractLoadBalancer<Value> {
protected isWeight: boolean;
protected pool: WeightValue<Value>[];
protected currentIndex: number;
protected constructor(pool: WeightValue<Value>[], isWeight: boolean);
/**
* pick a single member from the pool using the load balancing implementation
*
*/
abstract pick(): WeightValue<Value>;
poolSize(): number;
existedPool(): WeightValue<Value>[];
protected prepareWeights(pool: WeightValue<Value>[]): any[];
}