| Return type | Method name |
| TResult | await(Task< TResult > task ) throws ExecutionException, InterruptedException 阻塞线程,直到任务完成。 |
| TResult | await(Task< TResult > task,long timeout, TimeUnit unit) throws ExecutionException, InterruptedException 阻塞线程,直到任务完成。 |
| Task< TResult > | call(final Callable< TResult > callable) 根据Callable的执行结果返回一个新的任务。Callable在主线程中运行。 |
| Method |
public static < TResult > TResult await(Task< TResult > task) throws ExecutionException, InterruptedException |
| 阻塞线程,直到任务完成。 |
Parameters
| Parameter name | Parameter desc |
| task | 待操作任务。 |
| Parameter name | Parameter desc |
| ExecutionException | ExecutionException异常 |
| InterruptedException | InterruptedException异常 |
| type | desc |
| TResult | 任务执行结果。 |
| Method |
public static < TResult > TResult await(Task< TResult > task,long timeout, TimeUnit unit) throws ExecutionException, InterruptedException |
| 阻塞线程,直到任务完成或者超时时间结束。 |
Parameters
| Parameter name | Parameter desc |
| task | 待操作任务。 |
| timeout | 超时时间 |
| unit | 时间单位 |
| Parameter name | Parameter desc |
| ExecutionException | ExecutionException异常 |
| InterruptedException | InterruptedException异常 |
| type | desc |
| TResult | 任务执行结果。 |
| Method |
public static < TResult > Task< TResult > call(final Callable callable) |
| 根据Callable的执行结果返回一个新的任务。Callable在主线程中运行。 |
Parameters
| Parameter name | Parameter desc |
| task | 待操作任务。 |
| type | desc |
| TResult | 任务执行结果。 |