diff --git a/CHANGELOG.md b/CHANGELOG.md index 48757ac..d3beb24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # Changelog +## 2.5.0 (2018-10-24) + +* Feature: Add HTTP timeout option. + (#114 by @Rakdar and @clue) + + This now respects PHP's `default_socket_timeout` setting (default 60s) as a + timeout for sending the outgoing HTTP request and waiting for a successful + response and will otherwise cancel the pending request and reject its value + with an Exception. You can now use the [`timeout` option](#withoptions) to + pass a custom timeout value in seconds like this: + + ```php + $browser = $browser->withOptions(array( + 'timeout' => 10.0 + )); + + $browser->get($uri)->then(function (ResponseInterface $response) { + // response received within 10 seconds maximum + var_dump($response->getHeaders()); + }); + ``` + + Similarly, you can use a negative timeout value to not apply a timeout at + all or use a `null` value to restore the default handling. + +* Improve documentation for `withOptions()` and + add documentation and example for HTTP CONNECT proxy. + (#111 and #115 by @clue) + +* Refactor `Browser` to reuse single `Transaction` instance internally + which now accepts sending individual requests and their options. + (#113 by @clue) + ## 2.4.0 (2018-10-02) * Feature / Fix: Support cancellation forwarding and cancelling redirected requests. diff --git a/README.md b/README.md index 7cc25be..12c6770 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,16 @@ mess with most of the low-level details. Send any number of HTTP requests to any number of HTTP servers in parallel and process their responses as soon as results come in. The Promise-based design provides a *sane* interface to working with out of bound responses. +* **Standard interfaces** - + Allows easy integration with existing higher-level components by implementing + [PSR-7 (http-message)](https://www.php-fig.org/psr/psr-7/) interfaces, + ReactPHP's standard [promises](#promises) and [streaming interfaces](#streaming). * **Lightweight, SOLID design** - Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough) and does not get in your way. Builds on top of well-tested components and well-established concepts instead of reinventing the wheel. * **Good test coverage** - - Comes with an automated tests suite and is regularly tested in the *real world* + Comes with an automated tests suite and is regularly tested in the *real world*. **Table of contents** @@ -652,7 +656,7 @@ This project follows [SemVer](https://semver.org/). This will install the latest supported version: ```bash -$ composer require clue/buzz-react:^2.4 +$ composer require clue/buzz-react:^2.5 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.