this is a function doing some CPU heavy work that should be offloaded onto a thread_pool
| 20 | |
| 21 | // this is a function doing some CPU heavy work that should be offloaded onto a thread_pool |
| 22 | cobalt::promise<int> cpu_intense_work( |
| 23 | int a, int b, |
| 24 | boost::asio::executor_arg_t = {}, cobalt::executor = cobalt::this_thread::get_executor()) |
| 25 | // ^set the executor manually. but default it so we can still use it with the thread_local one if present |
| 26 | { |
| 27 | co_return a + b; |
| 28 | } |
| 29 | |
| 30 | cobalt::task<void> work(int min_a, int max_a, int b) |
| 31 | { |