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

Method wait

quantum/util/impl/quantum_generic_future_impl.h:185–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184template <typename T>
185void GenericFuture<T>::wait() const
186{
187 std::visit(Overloaded {
188 [](const ThreadContextPtr<T>& ctx) {
189 if (local::context()) {
190 cast::context<T>(ctx)->wait(local::context());
191 }
192 else {
193 ctx->wait();
194 }
195 },
196 [](const ThreadFuturePtr<T>& ctx) {
197 if (local::context()) {
198 cast::context<T>(ctx)->wait(local::context());
199 }
200 else {
201 ctx->wait();
202 }
203 },
204 [this](const CoroContextPtr<T>& ctx) {
205 if (local::context()) {
206 ctx->wait(_sync ? _sync : local::context());
207 }
208 else {
209 cast::context<T>(ctx)->wait();
210 }
211 },
212 [this](const CoroFuturePtr<T>& ctx) {
213 if (local::context()) {
214 ctx->wait(_sync ? _sync : local::context());
215 }
216 else {
217 cast::context<T>(ctx)->wait();
218 }
219 }
220 }, _context);
221}
222
223template <typename T>
224std::future_status GenericFuture<T>::waitFor(std::chrono::milliseconds timeMs) const

Callers 3

waitForTwoDependentsMethod · 0.45
waitForDependentsMethod · 0.45

Calls 2

FutureExceptionClass · 0.85
contextFunction · 0.70

Tested by

no test coverage detected