try taskflow in mana_auto_replay for the replay side
This commit is contained in:
parent
e426fb7628
commit
1e5a816330
3 changed files with 22 additions and 4 deletions
7
external/CMakeLists.txt
vendored
7
external/CMakeLists.txt
vendored
|
@ -20,3 +20,10 @@ if (NOT mesytec-mvlc)
|
|||
message(STATUS "${CMAKE_PROJECT_NAME}: Using mesytec-mvlc from ${CMAKE_CURRENT_SOURCE_DIR}/mesytec-mvlc")
|
||||
add_subdirectory(mesytec-mvlc)
|
||||
endif()
|
||||
|
||||
if (NOT taskflow)
|
||||
option(TF_BUILD_CUDA "Enables builds of cuda code" OFF)
|
||||
option(TF_BUILD_TESTS "Enables builds of tests" OFF)
|
||||
option(TF_BUILD_EXAMPLES "Enables builds of examples" OFF)
|
||||
add_subdirectory(taskflow-3.8.0)
|
||||
endif()
|
||||
|
|
|
@ -22,7 +22,7 @@ add_mnode_dev_executable(mesy_nng_pub_producer)
|
|||
add_mnode_dev_executable(mesy_nng_sub_consumer)
|
||||
|
||||
add_mnode_dev_executable(mana_auto_replay)
|
||||
target_link_libraries(mana_auto_replay PRIVATE mana mnode::resources)
|
||||
target_link_libraries(mana_auto_replay PRIVATE mana mnode::resources Taskflow)
|
||||
add_mnode_dev_executable(mana_nng_client)
|
||||
target_link_libraries(mana_nng_client PRIVATE mana mnode::resources)
|
||||
add_mnode_dev_executable(mana1)
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <mutex>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <sstream>
|
||||
#include <taskflow/taskflow.hpp>
|
||||
|
||||
#include "internal/argh.h"
|
||||
#include "internal/mana_analysis.h"
|
||||
|
@ -545,13 +546,23 @@ int main(int argc, char *argv[])
|
|||
auto destSink = mana.sink;
|
||||
mana.sink = serverPerfSink.get();
|
||||
|
||||
std::thread replayThread(run_replay);
|
||||
// FIXME: this is useless when running the client loop blocking like this
|
||||
// FIXME: clientQuit is useless when running the client loop blocking like this
|
||||
std::atomic<bool> clientQuit = false;
|
||||
#if 0
|
||||
std::thread replayThread(run_replay);
|
||||
mana::nng_client_run(clientSocket, destSink, clientQuit);
|
||||
if (replayThread.joinable())
|
||||
replayThread.join();
|
||||
fmt::print("Internal NngServerSink: {}\n", to_string(serverPerfSink->perf()));
|
||||
#else
|
||||
tf::Taskflow tf;
|
||||
tf.emplace(run_replay);
|
||||
tf::Executor executor;
|
||||
auto f = executor.run(tf);
|
||||
mana::nng_client_run(clientSocket, destSink, clientQuit);
|
||||
f.wait();
|
||||
|
||||
#endif
|
||||
// fmt::print("Internalthis NngServerSink: {}\n", to_string(serverPerfSink->perf()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue