| 179 | |
| 180 | foreachkey (const string& type, providers) { |
| 181 | foreachpair (const string& name, |
| 182 | const ProviderData& data, |
| 183 | providers[type]) { |
| 184 | if (data.removing.isSome()) { |
| 185 | continue; |
| 186 | } |
| 187 | |
| 188 | auto error = [=](const string& message) { |
| 189 | LOG(ERROR) << "Failed to launch resource provider with type '" << type |
| 190 | << "' and name '" << name << "': " << message; |
| 191 | }; |
| 192 | |
| 193 | launch(type, name) |
| 194 | .onFailed(error) |
| 195 | .onDiscarded(std::bind(error, "future discarded")); |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 |