public function update(Server $server) : Promise
{
switch ($server->state()) {
case Server::STARTED:
$this->watcherId = \Amp\repeat([$this, "updateTime"], 1000);
$this->updateTime();
break;
case Server::STOPPED:
\Amp\cancel($this->watcherId);
$this->watcherId = null;
break;
}
return new Success();
}