#ifndef TASK_RUNNER_REPLY_HH #define TASK_RUNNER_REPLY_HH #include "task_runner.hh" #include template void post_and_reply(TaskRunner* callback_runner, std::function callback, std::shared_ptr reply_runner, std::function reply) { callback_runner->post([callback, reply, reply_runner] () { auto r = callback(); reply_runner->post(std::bind(std::move(reply), std::move(r))); }); } #endif // TASK_RUNNER_REPLY_HH