getBody()->getContents(); $client = $this->getClient(); $response = $this->request($client, $content); $this->pool->push($client, $this->config['Address'], $this->config['Port']); return (new Response())->withBody(new Stream($response)); } /** * @return Client|\Swoole\Client * @throws ConfigException * @throws Exception */ private function getClient(): Client|\Swoole\Client { $this->config['pool'] = Config::get('rpc.pool', ['max' => 10, 'min' => 1, 'waite' => 60]); return $this->pool->get($this->config, function () { return $this->newClient(); }); } }