Remove duplicative generic actor repeatEvery() since recurring() exists.
This commit is contained in:
parent
d6e2d2a1fe
commit
84f9e00258
|
@ -10370,7 +10370,7 @@ TEST_CASE(":/redwood/performance/set") {
|
||||||
|
|
||||||
state Future<Void> stats =
|
state Future<Void> stats =
|
||||||
traceMetrics ? Void()
|
traceMetrics ? Void()
|
||||||
: repeatEvery(1.0, [&]() { printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str()); });
|
: recurring([&]() { printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str()); }, 1.0);
|
||||||
|
|
||||||
if (scans > 0) {
|
if (scans > 0) {
|
||||||
printf("Parallel scans, concurrency=%d, scans=%d, scanWidth=%d, scanPreftchBytes=%d ...\n",
|
printf("Parallel scans, concurrency=%d, scans=%d, scanWidth=%d, scanPreftchBytes=%d ...\n",
|
||||||
|
|
|
@ -221,6 +221,7 @@ Future<T> delayed(Future<T> what, double time = 0.0, TaskPriority taskID = TaskP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wait <interval> then call what() in a loop forever
|
||||||
ACTOR template <class Func>
|
ACTOR template <class Func>
|
||||||
Future<Void> recurring(Func what, double interval, TaskPriority taskID = TaskPriority::DefaultDelay) {
|
Future<Void> recurring(Func what, double interval, TaskPriority taskID = TaskPriority::DefaultDelay) {
|
||||||
loop choose {
|
loop choose {
|
||||||
|
@ -2048,15 +2049,6 @@ private:
|
||||||
Reference<UnsafeWeakFutureReferenceData> data;
|
Reference<UnsafeWeakFutureReferenceData> data;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Call a lambda every <interval> seconds
|
|
||||||
ACTOR template <typename Fn>
|
|
||||||
Future<Void> repeatEvery(double interval, Fn fn) {
|
|
||||||
loop {
|
|
||||||
wait(delay(interval));
|
|
||||||
fn();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "flow/unactorcompiler.h"
|
#include "flow/unactorcompiler.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue