public CompletableFuture < CommandResponse > command ( CommandRequest request ) { CompletableFuture < CommandResponse > future = new CompletableFuture <> ( ) ; if ( context . isCurrentContext ( ) ) { sendRequest ( request , protocol :: command , future ) ; } else { context . execute ( ( ) -> sendRequest ( request , protocol :: command , future ) ) ; } return future ; }
Sends a command request to the given node .