Code example for Future

Methods: cancelget

0
  } 
 
  @Override 
  public Void call() throws ExecutionException, InterruptedException {
    try { 
      future.get(timeout, unit);
    } catch (TimeoutException te) {
      future.cancel(true);
    } 
    return null; 
  } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java