MCPcopy Create free account
hub / github.com/3rdparty/libprocess / waited

Method waited

include/process/collect.hpp:170–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168 }
169
170 void waited(const Future<T>& future)
171 {
172 if (future.isFailed()) {
173 promise->fail("Collect failed: " + future.failure());
174 terminate(this);
175 } else if (future.isDiscarded()) {
176 promise->fail("Collect failed: future discarded");
177 terminate(this);
178 } else {
179 CHECK_READY(future);
180 ready += 1;
181 if (ready == futures.size()) {
182 std::vector<T> values;
183 values.reserve(futures.size());
184
185 foreach (const Future<T>& future, futures) {
186 values.push_back(future.get());
187 }
188
189 promise->set(std::move(values));
190 terminate(this);
191 }
192 }
193 }
194
195 const std::vector<Future<T>> futures;
196 Promise<std::vector<T>>* promise;

Callers

nothing calls this directly

Calls 6

isFailedMethod · 0.80
isDiscardedMethod · 0.80
terminateFunction · 0.70
failMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected