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/network/message_bridge_test.cc b/aos/network/message_bridge_test.cc
index 153f1e5..07a56f0 100644
--- a/aos/network/message_bridge_test.cc
+++ b/aos/network/message_bridge_test.cc
@@ -89,12 +89,12 @@
}
void RunPi1Server(chrono::nanoseconds duration) {
- // Setup a shutdown callback.
+ // Set up a shutdown callback.
aos::TimerHandler *const quit = pi1_server_event_loop->AddTimer(
[this]() { pi1_server_event_loop->Exit(); });
pi1_server_event_loop->OnRun([this, quit, duration]() {
// Stop between timestamps, not exactly on them.
- quit->Setup(pi1_server_event_loop->monotonic_now() + duration);
+ quit->Schedule(pi1_server_event_loop->monotonic_now() + duration);
});
pi1_server_event_loop->Run();
@@ -193,12 +193,12 @@
}
void RunPi2Server(chrono::nanoseconds duration) {
- // Setup a shutdown callback.
+ // Set up a shutdown callback.
aos::TimerHandler *const quit = pi2_server_event_loop->AddTimer(
[this]() { pi2_server_event_loop->Exit(); });
pi2_server_event_loop->OnRun([this, quit, duration]() {
// Stop between timestamps, not exactly on them.
- quit->Setup(pi2_server_event_loop->monotonic_now() + duration);
+ quit->Schedule(pi2_server_event_loop->monotonic_now() + duration);
});
pi2_server_event_loop->Run();
@@ -237,7 +237,7 @@
[this]() { pi2_client_event_loop->Exit(); });
pi2_client_event_loop->OnRun([this, quit, duration]() {
// Stop between timestamps, not exactly on them.
- quit->Setup(pi2_client_event_loop->monotonic_now() + duration);
+ quit->Schedule(pi2_client_event_loop->monotonic_now() + duration);
});
// And go!
@@ -594,7 +594,8 @@
[&ping_event_loop]() { ping_event_loop.Exit(); });
ping_event_loop.OnRun([quit, &ping_event_loop]() {
// Stop between timestamps, not exactly on them.
- quit->Setup(ping_event_loop.monotonic_now() + chrono::milliseconds(5050));
+ quit->Schedule(ping_event_loop.monotonic_now() +
+ chrono::milliseconds(5050));
});
// Find the channel index for both the /pi1/aos Timestamp channel and Ping