Creates a completed task with the given value.
(TResult value)
| 166 | * Creates a completed task with the given value. |
| 167 | */ |
| 168 | public static <TResult> Task<TResult> forResult(TResult value) { |
| 169 | Task<TResult>.TaskCompletionSource tcs = Task.<TResult> create(); |
| 170 | tcs.setResult(value); |
| 171 | return tcs.getTask(); |
| 172 | } |
| 173 | |
| 174 | /** |
| 175 | * Creates a faulted task with the given error. |