2017-05-22 05:54:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ipc.h"
|
|
|
|
#include "threaded_queue.h"
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2017-12-04 08:13:35 +00:00
|
|
|
class lsBaseOutMessage;
|
2017-05-22 05:54:27 +00:00
|
|
|
|
2017-12-04 08:13:35 +00:00
|
|
|
struct IpcManager {
|
|
|
|
struct StdoutMessage {
|
|
|
|
IpcId id;
|
|
|
|
std::string content;
|
|
|
|
};
|
2017-05-22 05:54:27 +00:00
|
|
|
|
2017-12-04 08:13:35 +00:00
|
|
|
ThreadedQueue<StdoutMessage> for_stdout;
|
|
|
|
ThreadedQueue<std::unique_ptr<BaseIpcMessage>> for_querydb;
|
2017-05-22 05:54:27 +00:00
|
|
|
|
2017-12-04 08:13:35 +00:00
|
|
|
static IpcManager* instance();
|
|
|
|
static void CreateInstance(MultiQueueWaiter* waiter);
|
2017-05-22 05:54:27 +00:00
|
|
|
|
2017-12-04 08:13:35 +00:00
|
|
|
static void WriteStdout(IpcId id, lsBaseOutMessage& response);
|
2017-05-22 05:54:27 +00:00
|
|
|
|
2017-09-22 01:14:57 +00:00
|
|
|
private:
|
2017-12-04 08:13:35 +00:00
|
|
|
explicit IpcManager(MultiQueueWaiter* waiter);
|
|
|
|
|
|
|
|
static IpcManager* instance_;
|
2017-05-22 05:54:27 +00:00
|
|
|
};
|