private void invokeAsync(Request req, double timeout, RequestWaiter waiter) {
            // TODO: Consider replacing this by a watcher on the target
            synchronized(this) { // ensure we have exactly 1 valid connection across threads
                if (! target.isValid()) {
                    target = supervisor.connect(new Spec(hostname, port));
                }
            }
            target.invokeAsync(req, timeout, waiter);
        }
A client which uses rpc request to search nodes to implement the Client API.

@author bratseth
container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcClient.java