@ Deprecated public static < T > Task < T > timeoutWithError ( final long time , final TimeUnit unit , final Task < T > task ) { return task . withTimeout ( time , unit ) ; }
Creates a new task that wraps the given task . If the given task finishes before the timeout occurs then this task takes on the value of the task . If the task does not complete in the given time then this task will have a TimeoutException . The wrapped task may be cancelled when a timeout occurs .