php-http / curl-client

cURL client
http://httplug.io
MIT License
443 stars 28 forks source link

Use the curl_reset function to allow resource reusing #1

Closed shulard closed 8 years ago

shulard commented 8 years ago

Since the PHP required version is 5.5, we can rely on the curl_reset function to manage curl handle.

It allow us to avoid create a new resource for each call. I've faced to some problem without reusing handles on previous project. Since that I always use that. It just reset all the attached option to the current handle.

dbu commented 8 years ago

could there be an issue with async requests? or can curl never do async anyways?

sagikazarmark commented 8 years ago

Actually we could backport curl_reset to PHP 5.4.

Is that possible at all? Maybe we could check if there is a symfony pollyfill for it.

shulard commented 8 years ago

It's not possible to create a polyfill to curl_reset. I've already tried to find a way to do that but we can't unset a config, we can just set its value.

I think that this PR is not a problem about the async thing, we just need to ensure that all is fine when async implementation is done.

dbu commented 8 years ago

i would not even try to support php 5.4. its end of life. see also #2

sagikazarmark commented 8 years ago

Yeah, if there is 1% need for PHP 5.5, use it.