Rename timer `Setup` function to `Schedule`
This patch was motivated by my desire to fix a typo in the function
name. The noun "setup" is 1 word. The verb "set up" is 2 words. All
other member functions are verbs, so this one should be a verb too.
That means that the function should be called `SetUp`. During the
discussion that resulted from the rename, James Kuszmaul pointed out
that "setting up" a timer can be confusing. It implies that you can
only "set up" a timer once. But the intent is to let users set up
timers as many times as they like. So we decided on renaming the
function to `Schedule`. That conveys the purpose and intent better.
I took this opportunity to fix some other typos involving the verb
"set up".
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I2f557d1f946960af82711f248820d5e2d385a5d3
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index 8b1b7fa..1c48d2c 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -434,8 +434,8 @@
// 100 ms / 0.05 ms -> 2000 messages. Should be enough to crash it.
ping_spammer_event_loop->OnRun([&ping_spammer_event_loop, timer_handler]() {
- timer_handler->Setup(ping_spammer_event_loop->monotonic_now(),
- chrono::microseconds(50));
+ timer_handler->Schedule(ping_spammer_event_loop->monotonic_now(),
+ chrono::microseconds(50));
});
Logger logger(logger_event_loop.get());
@@ -496,7 +496,7 @@
ping_spammer_event_loop->OnRun(
[&ping_spammer_event_loop, kSendPeriod, timer_handler]() {
- timer_handler->Setup(
+ timer_handler->Schedule(
ping_spammer_event_loop->monotonic_now() + kSendPeriod / 2,
kSendPeriod);
});