2017-12-05 08:14:46 +00:00
|
|
|
#include "message_handler.h"
|
|
|
|
|
|
|
|
#include <loguru.hpp>
|
|
|
|
|
2017-12-06 05:03:38 +00:00
|
|
|
namespace {
|
2018-03-22 04:05:25 +00:00
|
|
|
struct In_Exit : public NotificationMessage {
|
|
|
|
MethodType GetMethodType() const override { return kMethodType_Exit; }
|
2017-12-06 04:39:44 +00:00
|
|
|
};
|
2018-03-22 04:05:25 +00:00
|
|
|
MAKE_REFLECT_EMPTY_STRUCT(In_Exit);
|
|
|
|
REGISTER_IN_MESSAGE(In_Exit);
|
2017-12-06 04:39:44 +00:00
|
|
|
|
2018-03-22 04:05:25 +00:00
|
|
|
struct Handler_Exit : MessageHandler {
|
|
|
|
MethodType GetMethodType() const override { return kMethodType_Exit; }
|
2017-12-05 08:14:46 +00:00
|
|
|
|
|
|
|
void Run(std::unique_ptr<BaseIpcMessage> request) override {
|
2018-03-22 04:05:25 +00:00
|
|
|
LOG_S(INFO) << "Exiting; got exit message";
|
2017-12-05 08:14:46 +00:00
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
};
|
2018-03-22 04:05:25 +00:00
|
|
|
REGISTER_MESSAGE_HANDLER(Handler_Exit);
|
2017-12-31 03:18:33 +00:00
|
|
|
} // namespace
|