MCPcopy Create free account
hub / github.com/arkhipenko/TaskScheduler / runSchedulerUntil

Method runSchedulerUntil

tests/test-scheduler-basic.cpp:121–126  ·  view source on GitHub ↗

* @brief Helper method to run scheduler until condition is met or timeout * * Executes the scheduler repeatedly until either the specified condition * returns true or the timeout period expires. Essential for testing * time-dependent scheduler behavior without creating infinite loops. * * @param ts Reference to the Scheduler object to execute * @param condition

Source from the content-addressed store, hash-verified

119 * @return true if condition was met within timeout, false otherwise
120 */
121 bool runSchedulerUntil(Scheduler& ts, std::function<bool()> condition, unsigned long timeout_ms = 1000) {
122 return waitForCondition([&]() {
123 ts.execute();
124 return condition();
125 }, timeout_ms);
126 }
127};
128
129/**

Callers

nothing calls this directly

Calls 2

waitForConditionFunction · 0.85
executeMethod · 0.80

Tested by

no test coverage detected