public static < T > ComposableFuture < T > withTimeout ( final ComposableFuture < T > future , final long duration , final TimeUnit unit ) { return future . withTimeout ( SchedulerServiceHolder . INSTANCE , duration , unit ) ; }
adds a time cap to the provided future . if response do not arrive after the specified time a TimeoutException is returned from the returned future .