proxygen
|
#include <SignalHandler.h>
Public Member Functions | |
SignalHandler (HTTPServer *server) | |
void | install (const std::vector< int > &signals) |
Private Member Functions | |
void | signalReceived (int signum) noexceptoverride |
Private Member Functions inherited from folly::AsyncSignalHandler | |
AsyncSignalHandler (EventBase *eventBase) | |
virtual | ~AsyncSignalHandler () |
void | attachEventBase (EventBase *eventBase) |
void | detachEventBase () |
EventBase * | getEventBase () const |
void | registerSignalHandler (int signum) |
void | unregisterSignalHandler (int signum) |
Private Attributes | |
HTTPServer *const | server_ {nullptr} |
Installs signal handler which will stop HTTPServer when the user presses Ctrl-C. To be used if HTTPServer is the main process.
Note: Should only be created from the thread invoking HTTPServer::start()
.
Definition at line 25 of file SignalHandler.h.
|
explicit |
Definition at line 19 of file SignalHandler.cpp.
void proxygen::SignalHandler::install | ( | const std::vector< int > & | signals | ) |
Definition at line 24 of file SignalHandler.cpp.
References folly::AsyncSignalHandler::registerSignalHandler().
|
overrideprivatevirtualnoexcept |
signalReceived() will called to indicate that the specified signal has been received.
signalReceived() will always be invoked from the EventBase loop (i.e., after the main POSIX signal handler has returned control to the EventBase thread).
Implements folly::AsyncSignalHandler.
Definition at line 30 of file SignalHandler.cpp.
References server_, and proxygen::HTTPServer::stop().
|
private |
Definition at line 34 of file SignalHandler.h.
Referenced by signalReceived().