public function gracefulStop() { $this->graceful = true; Timer::add(function () { EventLoop::$instance->stop(); }, $this->reloadDelay * 1000000.0); $this->setState($this->state); }