@param int $cpuShares

@return Client
430336
public function setCpuShares(int $cpuShares)
    {
        $this->cpuShares = $cpuShares;

        $this->hostConfig = array_merge($this->hostConfig, ['CpuShares' => $cpuShares]);

        return $this;
    }
45902
public function ips($hours = 24, $class = null)
    {
        $zoneIps = $this->get('zoneIps', $this->data(compact('hours', 'class')), $hours.$class);

        $ips = array_get($zoneIps, 'response.ips');

        $all = new Collection();

        foreach ($ips as $ip) {
            $name = $ip['ip'];
            $zoneIp = new ZoneIP($this->client, $name, $this, ['zoneIp' => $ip]);
            $all->put($name, $zoneIp);
        }

        return $all;
    }
342727
public function serverInit($swooleServer, $asynManager)
    {
        $this->swooleServer = $swooleServer;
        $this->server       = $swooleServer->server;
        $this->asynManager  = $asynManager;

        return $this;
    }
1104529
public function shards()
    {
        $request = $this->createRequestInstance(self::CAT_SHARDS, null, null);

        return $this->client->send($request);
    }
623156
private function getClient($serverKey) {
    if (!isset($this->clients[$serverKey])) {
      $config = ObjectFactory::getInstance('configuration');
      $serverDef = $config->getValue($serverKey, 'remoteserver');
      // get remote the user
      $user = $this->getRemoteUser($serverKey);

      $client = null;
      if (strpos($serverDef, 'http://') === 0 || strpos($serverDef, 'https://') === 0) {
        $client = new HTTPClient($serverDef, $user);
      }
      else {
        $client = new RPCClient($serverDef, $user);
      }
      $this->clients[$serverKey] = $client;
    }
    return $this->clients[$serverKey];
  }
1016267
public function addProcessors(array $processors)
    {
        foreach ($processors as $key => $processor) {
            $this->addProcessor($processor, $key);
        }
        return $this;
    }
122392
protected function authClient(): ClientInterface
    {
        return new Client(new BasicAuth($this->clientId, $this->clientSecret), $this->auth_server);
    }
998644
public function getClient(): ClientInterface
    {
        if ($this->client === null) {
            $this->client = new Client();
        }

        return $this->client;
    }
1074425
protected function createAggregateClient(array $servers, array $options = []) {
        $options = array(
        	'lazy_connect' => true,
	        'pconnect'     => false,
	        'timeout'      => 0,
	    );

        $cluster = array();
        foreach ($servers as $key => $server) {
        	if ($key === 'cluster') continue;

        	$host    = empty($server['host'])    ? '127.0.0.1' : $server['host'];
            $port    = empty($server['port'])    ? '6379'      : $server['port'];

            $serializer = Redis::SERIALIZER_NONE;
            if (!empty($server['serializer'])) {
            	if ($server['serializer'] === 'none') {
            		$serializer = Redis::SERIALIZER_PHP;
            	} else if ($server['serializer'] === 'igbinary') {
                    if (defined('Redis::SERIALIZER_IGBINARY')) {
                        $serializer = Redis::SERIALIZER_IGBINARY;
                    } else {
                        $serializer = Redis::SERIALIZER_PHP;
                    }
            	}
            }

            $cluster[$host.':'.$port] = array(
            	'prefix'     => empty($server['prefix'])   ? '' : $server['prefix'],
            	'database'   => empty($server['database']) ? 0  : $server['database'],
            	'serializer' => $serializer,
        	);

            if (isset($server['persistent'])) {
            	$options['pconnect'] = $options['pconnect'] && $server['persistent'];
            } else {
				$options['pconnect'] = false;
            }

            if (!empty($server['timeout'])) {
            	$options['timeout'] = max($options['timeout'], $server['timeout']);
            }
        }

        $ra = new RedisArray(array_keys($cluster), $options);

        foreach ($cluster as $host => $options) {
        	$redis = $ra->_instance($host);
        	$redis->setOption(Redis::OPT_PREFIX, $options['prefix']);
        	$redis->setOption(Redis::OPT_SERIALIZER, $options['serializer']);
        	$redis->select($options['database']);
        }

        return array('default' => $ra);
    }
1161105
public function connect(array $servers)
	{
		$memcache = $this->getEngine();

		// For each server in the array, we'll just extract the configuration and add
		// the server to the Memcached connection. Once we have added all of these
		// servers we'll verify the connection is successful and return it back.
		foreach ($servers as $server)
		{
			$memcache->addServer(
				$server['host'], $server['port'], $server['weight']
			);
		}

		if ($memcache->getVersion() === false)
		{
			throw new RuntimeException('Could not establish Memcached connection.');
		}

		// Memcahed has no list keys, we do our own accounting, initialise key index
		if ($memcache->get($this->options['hash'] . '-index') === false)
		{
			$empty = array();
			self::$_db->set($this->oprions['hash'] . '-index', $empty, $this->options['compress'], 0);
		}

		return $memcache;
	}
117999
public function send(): ClientRequestInterface
   {
       try {
           $this->response = new ClientResponse(
               new ClientResponseStream($this));
       } catch (InvalidArgumentException $e) {
           throw new RuntimeException(
               "Can't send client request: " . $e->getMessage());
       }
       return $this;
   }
1030848
public static function createIndex($shards = null, $replicas = null)
    {
        $instance = new static();

        $client = $instance->getElasticSearchClient();

        $index = [
            'index'     => $instance->getIndexName(),
        ];

        if ($shards) {
            $index['body']['settings']['number_of_shards'] = $shards;
        }

        if ($replicas) {
            $index['body']['settings']['number_of_replicas'] = $replicas;
        }

        return $client->indices()->create($index);
    }
864626
public function connect(array $servers)
	{
		$memcache = $this->getMemcache();

		// For each server in the array, we'll just extract the configuration and add
		// the server to the Memcached connection. Once we have added all of these
		// servers we'll verify the connection is successful and return it back.
		foreach ($servers as $server)
		{
			$memcache->addServer(
				$server['host'], $server['port'], $server['weight']
			);
		}

		if ($memcache->getVersion() === false)
		{
			throw new RuntimeException("Could not establish Memcache connection.");
		}

		return $memcache;
	}
223768
public function setCpuRealtimeRuntime(int $cpuRealtimeRuntime)
    {
        $this->cpuRealtimeRuntime = $cpuRealtimeRuntime;

        $this->hostConfig = array_merge($this->hostConfig, [' CpuRealtimeRuntime ' => $cpuRealtimeRuntime]);

        return $this;
    }
824188
public function connect(array $servers): Cluster
    {
        $configure = array_merge($this->configure, $servers);
        $cluster = new Cluster($configure['host']);
        if (!empty($configure['user']) && !empty($configure['password'])) {
            $cluster->authenticateAs(strval($configure['user']), strval($configure['password']));
        }

        return $cluster;
    }
943156
private function parseConfiguredServers(array $servers): Collection
    {
        $result = new Collection();

        foreach ($servers as $server) {
            if (is_array($server)) {
                if (!empty(array_except($server, ['host', 'port', 'timeout']))) {
                    throw new InvalidConfigurationException('Servers in array notation may only contain a host, port and timeout parameter.');
                }
                if (!array_has($server, 'host')) {
                    throw new InvalidConfigurationException('For servers in array notation, the host parameter is required.');
                }

                $host = Arr::get($server, 'host');
                $port = Arr::get($server, 'port');
                $timeout = Arr::get($server, 'timeout', self::DEFAULT_TIMEOUT);

                $result->push(new Server($host, $port, $timeout));
            } else if (is_string($server)) {
                $result->push(new Server($server, null, self::DEFAULT_TIMEOUT));
            } else {
                throw new InvalidConfigurationException('The server configuration may only contain arrays or strings.');
            }
        }

        return $result;
    }
146175
public function serviceForCore($core)
    {
        $klass = Config::inst()->get(get_called_class(), 'core_class');
        return new $klass($this->_host, $this->_port, $this->_path . $core, $this->_httpTransport);
    }