24 void Process(
const std::shared_ptr<const JEvent>& event)
override;
28 void ListenForMessages();
29 void ProcessFileRequest(
const nlohmann::json& request);
30 void SendResponse(
const nlohmann::json& response);
31 void QueueResponse(
const nlohmann::json& response);
32 void OpenOutputFile(
const std::string& output_file);
33 nlohmann::json CloseOutputFile();
34 void NotifySourceNewFile(
const std::string& input_file);
35 bool IsCurrentFileComplete();
36 std::size_t GetNeventsInCurrentFile();
39 std::unique_ptr<zmq::context_t> m_zmq_context;
40 std::unique_ptr<zmq::socket_t> m_zmq_socket;
41 std::string m_socket_path =
"/tmp/eicrecon_managed.sock";
43 std::unique_ptr<std::thread> m_listener_thread;
44 std::atomic<bool> m_should_stop{
false};
47 std::string m_current_input_file;
48 std::string m_current_output_file;
49 bool m_file_processing_active =
false;
50 std::mutex m_file_mutex;
52 std::atomic<std::size_t> m_events_processed{0};
55 std::optional<nlohmann::json> m_queued_response;
56 std::condition_variable m_response_cv;
59 bool m_awaiting_reply =
false;