MCPcopy Create free account
hub / github.com/bloomberg/quantum / waitFor

Method waitFor

quantum/util/impl/quantum_generic_future_impl.h:224–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222
223template <typename T>
224std::future_status GenericFuture<T>::waitFor(std::chrono::milliseconds timeMs) const
225{
226 return std::visit(Overloaded {
227 [&](const ThreadContextPtr<T>& ctx)->decltype(auto) {
228 if (local::context()) {
229 return cast::context<T>(ctx)->waitFor(local::context(), timeMs);
230 }
231 else {
232 return ctx->waitFor(timeMs);
233 }
234 },
235 [&](const ThreadFuturePtr<T>& ctx)->decltype(auto) {
236 if (local::context()) {
237 return cast::context<T>(ctx)->waitFor(local::context(), timeMs);
238 }
239 else {
240 return ctx->waitFor(timeMs);
241 }
242 },
243 [&, this](const CoroContextPtr<T>& ctx)->decltype(auto) {
244 if (local::context()) {
245 return ctx->waitFor(_sync ? _sync : local::context(), timeMs);
246 }
247 else {
248 return cast::context<T>(ctx)->waitFor(timeMs);
249 }
250 },
251 [&, this](const CoroFuturePtr<T>& ctx)->decltype(auto) {
252 if (local::context()) {
253 return ctx->waitFor(_sync ? _sync : local::context(), timeMs);
254 }
255 else {
256 return cast::context<T>(ctx)->waitFor(timeMs);
257 }
258 }
259 }, _context);
260}
261
262template <typename T>
263template <typename V>

Callers 3

canTrimContextMethod · 0.45
isPendingContextMethod · 0.45
drainMethod · 0.45

Calls 2

FutureExceptionClass · 0.85
contextFunction · 0.70

Tested by

no test coverage detected