private Observable<Server> selectServer() {
        return Observable.create(new OnSubscribe<Server>() {
            @Override
            public void call(Subscriber<? super Server> next) {
                try {
                    Server server = loadBalancerContext.getServerFromLoadBalancer(loadBalancerURI, loadBalancerKey);   
                    next.onNext(server);
                    next.onCompleted();
                } catch (Exception e) {
                    next.onError(e);
                }
            }
        });
    }
private Observable < Server > selectServer ( ) { return Observable . create ( new OnSubscribe < Server > ( ) { @ Override public void call ( Subscriber < ? super Server > next ) { try { Server server = loadBalancerContext . getServerFromLoadBalancer ( loadBalancerURI , loadBalancerKey ) ; next . onNext ( server ) ; next . onCompleted ( ) ; } catch ( Exception e ) { next . onError ( e ) ; } } } ) ; }
Return an Observable that either emits only the single requested server
or queries the load balancer for the next server on each subscription