MCPcopy Create free account
hub / github.com/Snapchat/Valdi / waitForFuture

Function waitForFuture

valdi/test/utils/valdi_test_utils.hpp:201–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199
200template<typename T>
201T waitForFuture(std::future<T>& future) {
202 auto status = future.wait_for(std::chrono::seconds(1));
203 if (status != std::future_status::ready) {
204 throw Valdi::Exception("Timed out while waiting for future to become ready");
205 }
206 return future.get();
207}
208
209void runParallel(size_t threadsCount, int64_t durationSeconds, Valdi::DispatchFunction run);
210

Callers 1

TEST_PFunction · 0.85

Calls 2

getMethod · 0.65
ExceptionClass · 0.50

Tested by

no test coverage detected