6#include <userver/concurrent/async_event_channel.hpp>
7#include <userver/engine/task/task_processor_fwd.hpp>
8#include <userver/os_signals/subscriber.hpp>
9#include <userver/utils/internal_tag_fwd.hpp>
11USERVER_NAMESPACE_BEGIN
15#if !defined(__APPLE__)
37class Processor
final {
39 explicit Processor(engine::TaskProcessor& task_processor);
43 template <
class Class>
44 Subscriber
AddListener(Class* obj, std::string_view name,
int signum,
45 void (Class::*func)()) {
46 auto execute = [obj, func, signum](
int sig) {
52 return channel_.AddListener(concurrent::FunctionId(obj), name,
57 template <
class Class>
59 void (Class::*func)(
int )) {
60 auto execute = [obj, func](
int sig) { (obj->*func)(sig); };
61 return channel_.AddListener(concurrent::FunctionId(obj), name,
67 void Notify(
int signum, utils::InternalTag);
71 engine::TaskProcessor& task_processor_;