Aerys\Root::update PHP Method

update() public method

Receive notifications from the server when it starts/stops
public update ( Server $server ) : Amp\Promise
$server Server
return Amp\Promise
    public function update(Server $server) : amp\Promise
    {
        switch ($server->state()) {
            case Server::STARTING:
                $this->loadMimeFileTypes(__DIR__ . "/../etc/mime");
                break;
            case Server::STARTED:
                $this->debug = $server->getOption("debug");
                amp\enable($this->cacheWatcher);
                break;
            case Server::STOPPED:
                amp\disable($this->cacheWatcher);
                $this->cache = [];
                $this->cacheTimeouts = [];
                $this->cacheEntryCount = 0;
                $this->bufferedFileCount = 0;
                break;
        }
        return new amp\Success();
    }