MCPcopy Create free account
hub / github.com/David-Haim/concurrencpp / example_job

Function example_job

example/7_when_all/source/main.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "concurrencpp/concurrencpp.h"
8
9int example_job(int task_num, int dummy_value, int sleeping_time_ms) {
10 const auto msg0 =
11 std::string("task num: ") + std::to_string(task_num) + " is going to sleep for " + std::to_string(sleeping_time_ms) + " ms";
12 std::cout << msg0 << std::endl;
13
14 std::this_thread::sleep_for(std::chrono::milliseconds(sleeping_time_ms));
15
16 const auto msg1 = std::string("task num: ") + std::to_string(task_num) + " woke up.";
17 std::cout << msg1 << std::endl;
18
19 return dummy_value;
20}
21
22concurrencpp::result<void> consume_all_tasks(std::shared_ptr<concurrencpp::thread_pool_executor> resume_executor,
23 std::vector<concurrencpp::result<int>> results) {

Callers

nothing calls this directly

Calls 1

to_stringFunction · 0.50

Tested by

no test coverage detected