MCPcopy Create free account
hub / github.com/boostorg/asio / main

Function main

example/cpp11/executors/priority_scheduler.cpp:133–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131};
132
133int main()
134{
135 priority_scheduler sched;
136 auto low = sched.get_executor(0);
137 auto med = sched.get_executor(1);
138 auto high = sched.get_executor(2);
139 dispatch(low, []{ std::cout << "1\n"; });
140 dispatch(low, []{ std::cout << "11\n"; });
141 dispatch(med, []{ std::cout << "2\n"; });
142 dispatch(med, []{ std::cout << "22\n"; });
143 dispatch(high, []{ std::cout << "3\n"; });
144 dispatch(high, []{ std::cout << "33\n"; });
145 dispatch(high, []{ std::cout << "333\n"; });
146 dispatch(sched.get_executor(-1), [&]{ sched.stop(); });
147 sched.run();
148}

Callers

nothing calls this directly

Calls 4

dispatchFunction · 0.50
get_executorMethod · 0.45
stopMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected