protected function sendAsyncInternal(RequestInterface $request, callable $success, callable $error, int $retryCount = 0)
    {
        if (!$this->curlMultiHandle) {
            $this->curlMultiHandle = curl_multi_init();
        }
        $curl = curl_init();
        curl_setopt_array(
            $curl,
            $this->createCurlSettingsArray($request)
        );
        curl_multi_add_handle($this->curlMultiHandle, $curl);

        $resourceId = (int) $curl;
        $this->headerLinesMap[$resourceId] = [];
        $this->curlMultiMap[$resourceId] = [
            $request,
            $success,
            $error,
            $retryCount,
        ];
    }
protected function sendAsyncInternal(RequestInterface $request, callable $success, callable $error, int $retryCount = 0)
    {
        if (!$this->curlMultiHandle) {
            $this->curlMultiHandle = curl_multi_init();
        }
        $curl = curl_init();
        curl_setopt_array(
            $curl,
            $this->createCurlSettingsArray($request)
        );
        curl_multi_add_handle($this->curlMultiHandle, $curl);

        $resourceId = (int) $curl;
        $this->headerLinesMap[$resourceId] = [];
        $this->curlMultiMap[$resourceId] = [
            $request,
            $success,
            $error,
            $retryCount,
        ];
    }
protected function sendAsyncInternal ( RequestInterface $ request , callable $ success , callable $ error , int $ retryCount = 0 ) { if ( ! $ this -> curlMultiHandle ) { $ this -> curlMultiHandle = curl_multi_init ( ) ; } $ curl = curl_init ( ) ; curl_setopt_array ( $ curl , $ this -> createCurlSettingsArray ( $ request ) ) ; curl_multi_add_handle ( $ this -> curlMultiHandle , $ curl ) ; $ resourceId = ( int ) $ curl ; $ this -> headerLinesMap [ $ resourceId ] = [ ] ; $ this -> curlMultiMap [ $ resourceId ] = [ $ request , $ success , $ error , $ retryCount , ] ; }
Sends an asynchronous HTTP request.

We keep this in a separate method, so we can call it without triggering
the beforeRequest event and don't do the poll().
Sends an asynchronous HTTP request .