src/Actions/ManagesDaemons.php
public function createDaemon($serverId, array $data, $wait = true)
    {
        $daemon = $this->post("servers/$serverId/daemons", $data)['daemon'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $daemon) {
                $daemon = $this->daemon($serverId, $daemon['id']);

                return $daemon->status == 'installed' ? $daemon : null;
            });
        }

        return new Daemon($daemon + ['server_id' => $serverId], $this);
    }
public function createDaemon($serverId, array $data, $wait = true)
    {
        $daemon = $this->post("servers/$serverId/daemons", $data)['daemon'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $daemon) {
                $daemon = $this->daemon($serverId, $daemon['id']);

                return $daemon->status == 'installed' ? $daemon : null;
            });
        }

        return new Daemon($daemon + ['server_id' => $serverId], $this);
    }
public function createDaemon ( $ serverId , array $ data , $ wait = true ) { $ daemon = $ this -> post ( "servers/$serverId/daemons" , $ data ) [ 'daemon' ] ; if ( $ wait ) { return $ this -> retry ( $ this -> getTimeout ( ) , function ( ) use ( $ serverId , $ daemon ) { $ daemon = $ this -> daemon ( $ serverId , $ daemon [ 'id' ] ) ; return $ daemon -> status == 'installed' ? $ daemon : null ; } ) ; } return new Daemon ( $ daemon + [ 'server_id' => $ serverId ] , $ this ) ; }
Create a new daemon.

@param  integer $serverId
@param  array $data
@param  boolean $wait
@return Daemon
Create a new daemon .