Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2502#discussion_r159954152
--- Diff: storm-client/src/jvm/org/apache/storm/StormTimer.java ---
@@ -193,6 +210,24 @@ public void run() {
});
}
+ /**
+ * Schedule a function to run recurrently
+ * @param delayMs the number of millis to delay before running the
function
+ * @param recurMs the time between each invocation
+ * @param func the function to run
+ */
+ public void scheduleRecurringMs(long delayMs, final long recurMs,
final Runnable func) {
+ scheduleMs(delayMs, new Runnable() {
--- End diff --
nit could we use a java 8 lambda here instead?
```
scheduleMs(delayMs, () -> {
func.run();
// This avoids a race condition with cancel-timer.
scheduleMs(recurMs, this, true, 0);
});
```
---