6
* Fix: file_exists warning when resolving with long strings.
8
* Improve performance by prefixing all global functions calls with \ to skip the look up and resolve process and go straight to the global function.
13
* Feature: Improve memory consumption for pending promises by using static internal callbacks without binding to self.
18
* Feature: Significantly improve memory consumption and performance by only passing resolver args
19
to resolver and canceller if callback requires them. Also use static callbacks without
20
binding to promise, clean up canceller function reference when they are no longer
21
needed and hide resolver and canceller references from call stack on PHP 7+.
22
(#113, #115, #116, #117, #118, #119 and #123 by @clue)
24
These changes combined mean that rejecting promises with an `Exception` should
25
no longer cause any internal circular references which could cause some unexpected
26
memory growth in previous versions. By explicitly avoiding and explicitly
27
cleaning up said references, we can avoid relying on PHP's circular garbage collector
28
to kick in which significantly improves performance when rejecting many promises.
30
* Mark legacy progress support / notification API as deprecated
33
* Recommend rejecting promises by throwing an exception
36
* Improve documentation to properly instantiate LazyPromise
39
* Follower cancellation propagation was originally planned for this release
40
but has been reverted for now and is planned for a future release.
41
(#99 by @jsor and #122 by @clue)
45
* Fix circular references when resolving with a promise which follows
50
* Revert automatic cancellation of pending collection promises once the
51
output promise resolves. This was introduced in 42d86b7 (PR #36, released
52
in [v2.3.0](https://github.com/reactphp/promise/releases/tag/v2.3.0)) and
53
was both unintended and backward incompatible.
55
If you need automatic cancellation, you can use something like:
58
function allAndCancel(array $promises)
60
return \React\Promise\all($promises)
61
->always(function() use ($promises) {
62
foreach ($promises as $promise) {
63
if ($promise instanceof \React\Promise\CancellablePromiseInterface) {
70
* `all()` and `map()` functions now preserve the order of the array (#77).
71
* Fix circular references when resolving a promise with itself (#71).
75
* Fix `some()` not cancelling pending promises when too much input promises
80
* Support foreign thenables in `resolve()`.
81
Any object that provides a `then()` method is now assimilated to a trusted
82
promise that follows the state of this thenable (#52).
83
* Fix `some()` and `any()` for input arrays containing not enough items
88
* Allow cancellation of promises returned by functions working on promise
90
* Handle `\Throwable` in the same way as `\Exception` (#51 by @joshdifabio).
94
* Fix cancellation handlers called multiple times (#47 by @clue).
98
* Fix stack error when resolving a promise in its own fulfillment or
103
* Introduce new `ExtendedPromiseInterface` implemented by all promises.
104
* Add new `done()` method (part of the `ExtendedPromiseInterface`).
105
* Add new `otherwise()` method (part of the `ExtendedPromiseInterface`).
106
* Add new `always()` method (part of the `ExtendedPromiseInterface`).
107
* Add new `progress()` method (part of the `ExtendedPromiseInterface`).
108
* Rename `Deferred::progress` to `Deferred::notify` to avoid confusion with
109
`ExtendedPromiseInterface::progress` (a `Deferred::progress` alias is
110
still available for backward compatibility)
111
* `resolve()` now always returns a `ExtendedPromiseInterface`.
115
* Introduce new `CancellablePromiseInterface` implemented by all promises.
116
* Add new `cancel()` method (part of the `CancellablePromiseInterface`).
120
New major release. The goal is to streamline the API and to make it more
121
compliant with other promise libraries and especially with the new upcoming
122
[ES6 promises specification](https://github.com/domenic/promises-unwrapping/).
124
* Add standalone Promise class.
125
* Add new `race()` function.
126
* BC break: Bump minimum PHP version to PHP 5.4.
127
* BC break: Remove `ResolverInterface` and `PromiseInterface` from
129
* BC break: Change signature of `PromiseInterface`.
130
* BC break: Remove `When` and `Util` classes and move static methods to
132
* BC break: `FulfilledPromise` and `RejectedPromise` now throw an exception
133
when initialized with a promise instead of a value/reason.
134
* BC break: `Deferred::resolve()` and `Deferred::reject()` no longer return