Hello Alexey Serbin, Todd Lipcon,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/8130
to review the following change.
Change subject: periodic: add one-shot timers
......................................................................
periodic: add one-shot timers
One-shot timers will Stop() themselves after running a user task once.
Note: it's worth pointing out that if Callback() races with Snooze(), the
outcome is somewhat undefined. That is, there's no telling whether the
currently running callback will run the task or snooze it. The same holds
for one-shot timers, albeit more profoundly, as Callback() can also race
with Start(). To avoid this, Start() the one-shot timer from within the
task, or right after the task.
I also refactored one-shot and jitter percentage into a new options struct.
Change-Id: Ia4d9376172d66c92958071d5abbac63d751e41f3
---
M src/kudu/rpc/periodic-test.cc
M src/kudu/rpc/periodic.cc
M src/kudu/rpc/periodic.h
3 files changed, 134 insertions(+), 18 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/30/8130/1
--
To view, visit http://gerrit.cloudera.org:8080/8130
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4d9376172d66c92958071d5abbac63d751e41f3
Gerrit-Change-Number: 8130
Gerrit-PatchSet: 1
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>