| 706 | } |
| 707 | |
| 708 | void wait(const vector<TaskID>& taskIds) |
| 709 | { |
| 710 | CHECK_EQ(SUBSCRIBED, state); |
| 711 | CHECK(!containers.empty()); |
| 712 | CHECK_SOME(connectionId); |
| 713 | |
| 714 | LOG(INFO) << "Waiting on child containers of tasks " << stringify(taskIds); |
| 715 | |
| 716 | vector<Future<Connection>> connections; |
| 717 | for (size_t i = 0; i < taskIds.size(); i++) { |
| 718 | connections.push_back(process::http::connect(agent)); |
| 719 | } |
| 720 | |
| 721 | process::collect(connections) |
| 722 | .onAny(defer( |
| 723 | self(), &Self::_wait, lambda::_1, taskIds, connectionId.get())); |
| 724 | } |
| 725 | |
| 726 | void _wait( |
| 727 | const Future<vector<Connection>>& _connections, |