Closed
Description
Description
I've got the following design. Symfony App is run in Swoole Worker. It means it's alive permanently and runs as a daemon.
Clients -> Symfony App with HTTP Client -> external services
When we got a request from clients, we send a POST HTTP request to the external services. These external services support "Connection: keep-alive" but Symfony HTTP Client creates Curl Handler for each request. Therefore I cannot refer to "keep-alive connection" because it creates a TCP Connection always but I'd like to use created one previously.
In the "CurlHTTPClient" file, this code is run for each request.
if (!$pushedResponse) {
$ch = curl_init();
$this->logger && $this->logger->info(sprintf('Request: "%s %s"', $method, $url));
$curlopts += [\CURLOPT_SHARE => $this->multi->share];
}
Is there an option to keep this curl handler for the next requests from clients in Symfony HTTP Client?
Example
No response