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/starter/subprocess.cc b/aos/starter/subprocess.cc
index b86b12d..d907d3f 100644
--- a/aos/starter/subprocess.cc
+++ b/aos/starter/subprocess.cc
@@ -125,8 +125,8 @@
// Every second poll to check if the child is dead. This is used as a
// default for the case where the user is not directly catching SIGCHLD and
// calling MaybeHandleSignal for us.
- child_status_handler_->Setup(event_loop_->monotonic_now(),
- std::chrono::seconds(1));
+ child_status_handler_->Schedule(event_loop_->monotonic_now(),
+ std::chrono::seconds(1));
});
}
@@ -172,8 +172,8 @@
stderr_.clear();
}
- pipe_timer_->Setup(event_loop_->monotonic_now(),
- std::chrono::milliseconds(100));
+ pipe_timer_->Schedule(event_loop_->monotonic_now(),
+ std::chrono::milliseconds(100));
const pid_t pid = fork();
@@ -189,10 +189,10 @@
status_ = aos::starter::State::STARTING;
LOG(INFO) << "Starting '" << name_ << "' pid " << pid_;
- // Setup timer which moves application to RUNNING state if it is still
+ // Set up timer which moves application to RUNNING state if it is still
// alive in 1 second.
- start_timer_->Setup(event_loop_->monotonic_now() +
- std::chrono::seconds(1));
+ start_timer_->Schedule(event_loop_->monotonic_now() +
+ std::chrono::seconds(1));
// Since we are the parent process, clear our write-side of all the pipes.
status_pipes_.write.reset();
stdout_pipes_.write.reset();
@@ -331,8 +331,8 @@
// Watchdog timer to SIGKILL application if it is still running 1 second
// after SIGINT
- stop_timer_->Setup(event_loop_->monotonic_now() +
- std::chrono::seconds(1));
+ stop_timer_->Schedule(event_loop_->monotonic_now() +
+ std::chrono::seconds(1));
queue_restart_ = restart;
on_change_();
break;
@@ -370,7 +370,8 @@
status_ = aos::starter::State::WAITING;
LOG(INFO) << "Restarting " << name_ << " in 3 seconds";
- restart_timer_->Setup(event_loop_->monotonic_now() + std::chrono::seconds(3));
+ restart_timer_->Schedule(event_loop_->monotonic_now() +
+ std::chrono::seconds(3));
start_timer_->Disable();
stop_timer_->Disable();
on_change_();