ccls/src/messages/exit.cc

22 lines
554 B
C++
Raw Normal View History

2017-12-05 08:14:46 +00:00
#include "message_handler.h"
#include <loguru.hpp>
namespace {
struct In_Exit : public NotificationMessage {
MethodType GetMethodType() const override { return kMethodType_Exit; }
2017-12-06 04:39:44 +00:00
};
MAKE_REFLECT_EMPTY_STRUCT(In_Exit);
REGISTER_IN_MESSAGE(In_Exit);
2017-12-06 04:39:44 +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 {
LOG_S(INFO) << "Exiting; got exit message";
2017-12-05 08:14:46 +00:00
exit(0);
}
};
REGISTER_MESSAGE_HANDLER(Handler_Exit);
} // namespace