Unverified Commit 6b09274b authored by Dennis Jenkins's avatar Dennis Jenkins Committed by GitHub

Merge pull request #198 from VishwanathPatil/dev

Client example : Wait for response and print number of failed requests
parents 2ea1c2dd c14007f8
......@@ -49,12 +49,13 @@ int main(int argc, char *argv[]) {
std::cout << "Response body = " << body << std::endl;
}, Async::IgnoreException);
responses.push_back(std::move(resp));
}
auto sync = Async::whenAll(responses.begin(), responses.end());
Async::Barrier<std::vector<Http::Response>> barrier(sync);
auto sync = Async::whenAll(responses.begin(), responses.end());
Async::Barrier<std::vector<Http::Response>> barrier(sync);
barrier.wait_for(std::chrono::seconds(5));
if(barrier.wait_for(std::chrono::seconds(5)) == std::cv_status::timeout) {
++failedRequests;
}
}
auto end = std::chrono::system_clock::now();
std::cout << "Summary of execution" << std::endl
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment