userver: os_signals::Processor Class Reference
Loading...
Searching...
No Matches
os_signals::Processor Class Referencefinal

#include <userver/os_signals/processor.hpp>

Detailed Description

A client that allows you to subscribe to OS signals SIGUSR1 and SIGUSR2.

Usually retrieved from os_signals::ProcessorComponent. For tests use os_signals::ProcessorMock.

See also
Handling OS signals

Definition at line 37 of file processor.hpp.

Public Member Functions

 Processor (engine::TaskProcessor &task_processor)
template<class Class>
void AddListener (utils::ResourceScopeStorage &scopes, Class *obj, std::string_view name, int signum, void(Class::*func)())
 Listens for a specific signal during the resource scope lifetime.
template<class Class>
void AddListener (utils::ResourceScopeStorage &scopes, Class *obj, std::string_view name, void(Class::*func)(int))
 Listens for all OS signals during the resource scope lifetime.
template<class Class>
Subscriber AddListener (Class *obj, std::string_view name, int signum, void(Class::*func)())
template<class Class>
Subscriber AddListener (Class *obj, std::string_view name, void(Class::*func)(int))

Member Function Documentation

◆ AddListener() [1/4]

template<class Class>
Subscriber os_signals::Processor::AddListener ( Class * obj,
std::string_view name,
int signum,
void(Class::* func )() )
inline

Listen for a specific signal signum. See the other overload for subscription to both signals.

Deprecated
Use the overload that takes utils::ResourceScopeStorage.

Definition at line 72 of file processor.hpp.

◆ AddListener() [2/4]

template<class Class>
Subscriber os_signals::Processor::AddListener ( Class * obj,
std::string_view name,
void(Class::* func )(int) )
inline

Listen for all the OS signals.

Deprecated
Use the overload that takes utils::ResourceScopeStorage.

Definition at line 85 of file processor.hpp.

◆ AddListener() [3/4]

template<class Class>
void os_signals::Processor::AddListener ( utils::ResourceScopeStorage & scopes,
Class * obj,
std::string_view name,
int signum,
void(Class::* func )() )
inline

Listens for a specific signal during the resource scope lifetime.

Parameters
scopesstorage that owns the subscription lifetime. See where to obtain scopes.

Definition at line 45 of file processor.hpp.

◆ AddListener() [4/4]

template<class Class>
void os_signals::Processor::AddListener ( utils::ResourceScopeStorage & scopes,
Class * obj,
std::string_view name,
void(Class::* func )(int) )
inline

Listens for all OS signals during the resource scope lifetime.

Parameters
scopesstorage that owns the subscription lifetime. See where to obtain scopes.

Definition at line 63 of file processor.hpp.


The documentation for this class was generated from the following file: