Create a future that indicates that the task observed by the given status queue is finished.
| 399 | // Create a future that indicates that the task observed by the given |
| 400 | // status queue is finished. |
| 401 | static Future<Nothing> awaitFinished(FetcherCacheTest::Task task) |
| 402 | { |
| 403 | return task.statusQueue.get() |
| 404 | .then([=](const TaskStatus& status) -> Future<Nothing> { |
| 405 | if (status.state() == TASK_FINISHED) { |
| 406 | return Nothing(); |
| 407 | } |
| 408 | return awaitFinished(task); |
| 409 | }); |
| 410 | } |
| 411 | |
| 412 | |
| 413 | // Create a future that indicates that all tasks are finished. |