proxygen
SignalHandler.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
11 
14 
16 
17 namespace proxygen {
18 
20  : folly::AsyncSignalHandler(EventBaseManager::get()->getEventBase()),
21  server_(server) {
22 }
23 
24 void SignalHandler::install(const std::vector<int>& signals) {
25  for (const int& signal: signals) {
26  registerSignalHandler(signal);
27  }
28 }
29 
30 void SignalHandler::signalReceived(int /*signum*/) noexcept { server_->stop(); }
31 }
SignalHandler(HTTPServer *server)
HTTPServer *const server_
Definition: SignalHandler.h:34
EventBase * getEventBase()
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
void signalReceived(int signum) noexceptoverride
requires E e noexcept(noexcept(s.error(std::move(e))))
void install(const std::vector< int > &signals)
void registerSignalHandler(int signum)
PUSHMI_INLINE_VAR constexpr detail::get_fn< T > get
Definition: submit.h:391