run_market_datapublishers should have an option to not return.

This commit is contained in:
Eric Harding committed 2018-02-01 13:57:29 -05:00
1 parent 4ac7753a4e
commit 7ba2062e21
2 files changed
+9 -4

No files matched your search

+8 -3
View File
@@ -63,7 +63,7 @@ void run_cleanup() {
}
std::thread* _md_thread;
void run_market_datapublishers() {
void run_market_datapublishers(bool should_return) {
bts_assert(_md_thread == nullptr);
// start a thread for the md
_md_thread = new std::thread([]() {
@@ -78,7 +78,12 @@ void run_market_datapublishers() {
}
});
std::this_thread::sleep_for(2s);
if(should_return) {
std::this_thread::sleep_for(2s);
}
else {
_md_thread->join();
}
}
void run_record(const std::string& arg){
@@ -137,7 +142,7 @@ void md_tool(std::vector<std::string> const &args) {
else if (cmd == "cleanup") run_cleanup();
else if (cmd == "dump") run_dump(args.size() > 1 ? args[1] : "", args.size() > 2 ? args[2] : "");
else if (cmd == "replay") run_replay();
else if (cmd == "run") run_market_datapublishers();
else if (cmd == "run") run_market_datapublishers(false);
else if (cmd == "relay") relay_everything();
else printhelp();
}
+1 -1
View File
@@ -5,7 +5,7 @@
namespace bts {
namespace md {
void run_market_datapublishers();
void run_market_datapublishers(bool should_return=true);
void md_tool(std::vector<std::string> const& args);
}}