Turns a Task into a Task , dropping any result.
()
| 203 | * Turns a Task<T> into a Task<Void>, dropping any result. |
| 204 | */ |
| 205 | public Task<Void> makeVoid() { |
| 206 | return this.continueWithTask(new Continuation<TResult, Task<Void>>() { |
| 207 | public Task<Void> then(Task<TResult> task) throws Exception { |
| 208 | if (task.isCancelled()) { |
| 209 | return Task.cancelled(); |
| 210 | } |
| 211 | if (task.isFaulted()) { |
| 212 | return Task.forError(task.getError()); |
| 213 | } |
| 214 | return Task.forResult(null); |
| 215 | } |
| 216 | }); |
| 217 | } |
| 218 | |
| 219 | /** |
| 220 | * Invokes the callable on a background thread using the default thread pool, returning a Task to |
no test coverage detected