2017-12-05 08:14:46 +00:00
|
|
|
#include "message_handler.h"
|
|
|
|
|
|
|
|
#include <loguru.hpp>
|
|
|
|
|
2017-12-06 05:03:38 +00:00
|
|
|
namespace {
|
2017-12-06 04:39:44 +00:00
|
|
|
struct Ipc_Exit : public IpcMessage<Ipc_Exit> {
|
|
|
|
static const IpcId kIpcId = IpcId::Exit;
|
|
|
|
};
|
|
|
|
MAKE_REFLECT_EMPTY_STRUCT(Ipc_Exit);
|
|
|
|
REGISTER_IPC_MESSAGE(Ipc_Exit);
|
|
|
|
|
2017-12-05 08:14:46 +00:00
|
|
|
struct ExitHandler : MessageHandler {
|
|
|
|
IpcId GetId() const override { return IpcId::Exit; }
|
|
|
|
|
|
|
|
void Run(std::unique_ptr<BaseIpcMessage> request) override {
|
|
|
|
LOG_S(INFO) << "Exiting; got IpcId::Exit";
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
REGISTER_MESSAGE_HANDLER(ExitHandler);
|
2017-12-31 03:18:33 +00:00
|
|
|
} // namespace
|