38template<
template<
typename>
typename kind_of,
event_c event_t>
42 auto hf_ptr = std::make_shared<handler_f<kind_of, event_t>>(std::move(hf));
44 auto guard = std::lock_guard{mtx_m};
46 if constexpr (async_kind_c<kind_of<event_t>>)
48 return insert_jhf<kind_of, event_t>(s_id, [&, hf_ptr](job j) {
49 auto task = std::packaged_task([hf_ptr](std::stop_token tk, job j) {
50 auto ke = j.event<kind_of, event_t>();
54 md.set_job_id(j.id());
56 md.set_stop_token(tk);
58 (*hf_ptr)(std::move(ke));
61 runner_m.start_thread(spec<kind_of<event_t>>::hash, std::move(task),
67 return insert_jhf<kind_of, event_t>(s_id, [hf_ptr](job j) {
68 auto ke = j.event<kind_of, event_t>();
70 ke.md().set_job_id(j.id());
std::move_only_function< void(hf_arg< kind_of, event_t >)> handler_f