Aerys\Ticker::update PHP Method

update() public method

public update ( Server $server ) : Promise
$server Server
return Promise
    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();
    }