chore: auto-commit (6 archivos)
- CMakeLists.txt - main.cpp - data_collectors.cpp - data_collectors.h - runner.cpp - runner.h Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace odr {
|
||||
|
||||
struct RunResult {
|
||||
int exit_code = -1;
|
||||
long long duration_ms = 0;
|
||||
std::string stdout_str;
|
||||
std::string stderr_str;
|
||||
};
|
||||
|
||||
// Synchronous subprocess runner. Bloquea el hilo caller hasta que el
|
||||
// subprocess termina. UI debe llamarlo desde un thread propio o aceptar
|
||||
// el bloqueo (MVP: aceptar bloqueo).
|
||||
//
|
||||
// Layout temp:
|
||||
// <tmp_dir>/ctx_<uid>.json — escrito por runner
|
||||
// <tmp_dir>/out_<uid>.json — stdout capturado
|
||||
// <tmp_dir>/err_<uid>.log — stderr capturado
|
||||
//
|
||||
// Usa std::system. python_exe puede ser path absoluto o ejecutable en PATH.
|
||||
// run_py es el path absoluto al run.py del collector.
|
||||
//
|
||||
// Retorna RunResult con exit_code=0 en exito.
|
||||
RunResult run_collector(const std::string& python_exe,
|
||||
const std::string& run_py,
|
||||
const std::string& tmp_dir,
|
||||
const std::string& ctx_json);
|
||||
|
||||
} // namespace odr
|
||||
Reference in New Issue
Block a user