Closed ghost closed 7 years ago
I don't think it makes sense to add this, since it's not part of the interface.
This timeout should instead be set at construction imo.
Not sure why this was closed and not added. It is part of the client and @m0byd1ck PR is easy to implement and would have saved me lots of time.
However, for those looking for example of what @GrahamCampbell is talking about instead of this:
$adapter = new BuzzAdapter('DIGITAL_OCEAN_API_KEY');
$digitalocean = new DigitalOceanV2($adapter);
$digitalocean_sizes = $digitalocean->size()->getAll();
You would do this:
use Buzz\Browser;
use Buzz\Client\Curl;
use Buzz\Client\FileGetContents;
...
$browser = new Browser(function_exists('curl_exec') ? new Curl() : new FileGetContents());
$browser->getClient()->setTimeout(15);
$adapter = new BuzzAdapter('DIGITAL_OCEAN_API_KEY', $browser);
$digitalocean = new DigitalOceanV2($adapter);
$digitalocean_sizes = $digitalocean->size()->getAll();
Ability to set timeout