@Test public void integrationTest() { final InstanceManager<Integer> instances = InstanceManager.create(); final LoadBalancer<Client> lb = LoadBalancer .fromSource(instances.map(Client.connector())) .withQuarantiner(Client.incarnationFactory(), Delays.fixed(1, TimeUnit.SECONDS), scheduler) .build(ChoiceOfTwoLoadBalancer.<Client>create(Client.compareByMetric())); instances.add(1); Client client = lb.next(); instances.add(2); client = lb.next(); }
public static <T> InstanceQuarantiner<T> create( IncarnationFactory<T> factory, DelayStrategy backoffStrategy, Scheduler scheduler) { return new InstanceQuarantiner<T>(factory, backoffStrategy, scheduler); }
InstanceQuarantiner implements Func1<Instance<T>, Observable<Instance<T>>> { public static <T> InstanceQuarantiner<T> create( IncarnationFactory<T> factory, DelayStrategy backoffStrategy, Scheduler scheduler) { return new InstanceQuarantiner<T>(factory, backoffStrategy, scheduler); } }
InstanceQuarantiner implements Func1<Instance<T>, Observable<Instance<T>>> { public static <T> InstanceQuarantiner<T> create( IncarnationFactory<T> factory, DelayStrategy backoffStrategy, Scheduler scheduler) { return new InstanceQuarantiner<T>(factory, backoffStrategy, scheduler); } InstanceQuarantiner(IncarnationFactory<T> factory, DelayStrategy backoffStrategy, Scheduler scheduler); }
InstanceQuarantiner implements Func1<Instance<T>, Observable<Instance<T>>> { public static <T> InstanceQuarantiner<T> create( IncarnationFactory<T> factory, DelayStrategy backoffStrategy, Scheduler scheduler) { return new InstanceQuarantiner<T>(factory, backoffStrategy, scheduler); } InstanceQuarantiner(IncarnationFactory<T> factory, DelayStrategy backoffStrategy, Scheduler scheduler); static InstanceQuarantiner<T> create(
            IncarnationFactory<T> factory,
            DelayStrategy         backoffStrategy, 
            Scheduler             scheduler); @Override Observable<Instance<T>> call(final Instance<T> primaryInstance); }
InstanceQuarantiner implements Func1<Instance<T>, Observable<Instance<T>>> { public static <T> InstanceQuarantiner<T> create( IncarnationFactory<T> factory, DelayStrategy backoffStrategy, Scheduler scheduler) { return new InstanceQuarantiner<T>(factory, backoffStrategy, scheduler); } InstanceQuarantiner(IncarnationFactory<T> factory, DelayStrategy backoffStrategy, Scheduler scheduler); static InstanceQuarantiner<T> create(
            IncarnationFactory<T> factory,
            DelayStrategy         backoffStrategy, 
            Scheduler             scheduler); @Override Observable<Instance<T>> call(final Instance<T> primaryInstance);  }