20 #include <FairMQLogger.h>
37 fParameterName = fConfig->GetValue<
string>(
"parameter-name");
38 fMaxIterations = fConfig->GetValue<uint64_t>(
"max-iterations");
44 LOG(info) <<
"Requesting parameter \"" << fParameterName <<
"\" for Run ID " << fRunId <<
".";
48 FairMQMessagePtr req(NewSimpleMessage(fParameterName +
"," + to_string(fRunId)));
49 FairMQMessagePtr rep(NewMessage());
51 if (Send(req,
"data") > 0) {
52 if (Receive(rep,
"data") >= 0) {
53 if (rep->GetSize() != 0) {
55 Deserialize<RootSerializer>(*rep,
par);
56 LOG(info) <<
"Received parameter from the server:";
60 LOG(error) <<
"Received empty reply. Parameter not available";
65 fRunId == 2099 ? fRunId = 2000 : fRunId++;
67 if (fMaxIterations > 0 && ++fNumIterations >= fMaxIterations) {
68 LOG(info) <<
"Configured maximum number of iterations reached. Leaving RUNNING state.";
72 this_thread::sleep_for(chrono::seconds(1));
virtual ~FairMQExParamsClient()
FairMQExParamsParOne * par
virtual bool ConditionalRun()