Skip to content

Commit

Permalink
region example: fix msg counter
Browse files Browse the repository at this point in the history
  • Loading branch information
rbx committed May 7, 2021
1 parent 8b4056e commit 4e46651
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 1 addition & 8 deletions examples/region/Sampler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* Sampler.cpp
*
* @since 2014-10-10
* @author A. Rybalchenko
*/

#include "Sampler.h"

Expand Down Expand Up @@ -75,20 +69,19 @@ bool Sampler::ConditionalRun()
// std::this_thread::sleep_for(std::chrono::seconds(1));

lock_guard<mutex> lock(fMtx);
++fNumUnackedMsgs;
if (Send(msg, "data", 0) > 0) {
if (fMaxIterations > 0 && ++fNumIterations >= fMaxIterations) {
LOG(info) << "Configured maximum number of iterations reached. Leaving RUNNING state.";
return false;
}
}
++fNumUnackedMsgs;

return true;
}

void Sampler::ResetTask()
{
// On destruction UnmanagedRegion will try to TODO
fRegion.reset();
{
lock_guard<mutex> lock(fMtx);
Expand Down
1 change: 1 addition & 0 deletions examples/region/test-ex-region.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ SAMPLER_PID=$!
SINK="fairmq-ex-region-sink"
SINK+=" --id sink1"
SINK+=" --transport $transport"
SINK+=" --severity debug"
SINK+=" --session $SESSION"
SINK+=" --verbosity veryhigh"
SINK+=" --control static --color false"
Expand Down

0 comments on commit 4e46651

Please sign in to comment.