Aerys\Server::state PHP Method

state() public method

Retrieve the current server state
public state ( ) : integer
return integer
    public function state() : int
    {
        return $this->state;
    }

Usage Example

Example #1
0
 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();
 }
All Usage Examples Of Aerys\Server::state