ccls/src/ipc_manager.cc
Jacob Dufault 6c5f1d9c88 Simplify IpcManager.
It no longer supports multi-process IPC; remove some of the extra code that was used to support that.
2017-12-04 00:13:35 -08:00

31 lines
661 B
C++

#include "ipc_manager.h"
#include "language_server_api.h"
#include <sstream>
IpcManager* IpcManager::instance_ = nullptr;
// static
IpcManager* IpcManager::instance() {
return instance_;
}
// static
void IpcManager::CreateInstance(MultiQueueWaiter* waiter) {
instance_ = new IpcManager(waiter);
}
// static
void IpcManager::WriteStdout(IpcId id, lsBaseOutMessage& response) {
std::ostringstream sstream;
response.Write(sstream);
StdoutMessage out;
out.content = sstream.str();
out.id = id;
instance()->for_stdout.Enqueue(std::move(out));
}
IpcManager::IpcManager(MultiQueueWaiter* waiter)
: for_stdout(waiter), for_querydb(waiter) {}