mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Tests for MQ examples
This commit is contained in:
@@ -25,12 +25,15 @@ using namespace std;
|
||||
|
||||
FairMQExample6Sampler::FairMQExample6Sampler()
|
||||
: fText()
|
||||
, fMaxIterations(0)
|
||||
, fNumIterations(0)
|
||||
{
|
||||
}
|
||||
|
||||
void FairMQExample6Sampler::InitTask()
|
||||
{
|
||||
fText = fConfig->GetValue<string>("text");
|
||||
fMaxIterations = fConfig->GetValue<uint64_t>("max-iterations");
|
||||
}
|
||||
|
||||
void FairMQExample6Sampler::Run()
|
||||
@@ -62,6 +65,12 @@ void FairMQExample6Sampler::Run()
|
||||
LOG(INFO) << "Sent \"" << fText << "\"";
|
||||
}
|
||||
}
|
||||
|
||||
if (fMaxIterations > 0 && ++fNumIterations >= fMaxIterations)
|
||||
{
|
||||
LOG(INFO) << "Configured maximum number of iterations reached. Leaving RUNNING state.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user