reactphp/promise — pull request #19 by jsor (2014-08-15 11:57:02+00:00)
Title: [WIP] Introduce ExtendedPromiseInterface

The ExtendedPromiseInterface extends the PromiseInterface with useful shortcut
and utility methods which are not part of the Promises/A specification.

Implemented methods:

ExtendedPromiseInterface::done()
----------------------------------------------
When working with promises, it's a common issue that exceptions (and/or rejections) get _lost_ because there is no way to break out of a promise chain.

With the new `ExtendedPromiseInterface::done()` you can _end_ a promise chain and unhandled rejections/exceptions will be rethrown in an uncatchable way causing a fatal error.

In Javascript, promise libs often do it by rethrowing the exception in `nextTick()` to break out of the promise chain. Since that is not possible for React\Promise, a special Exception `React\Promise\UnhandledRejectionException` is used which can be [passed through the promise chain](https://github.com/reactphp/promise/blob/extended-promise/src/RejectedPromise.php#L26-L27).

See also:
* [done() vs. then()](https://github.com/reactphp/promise/tree/extended-promise#done-vs-then)
* [ExtendedPromiseInterface::done()](https://github.com/reactphp/promise/tree/extended-promise#extendedpromiseinterfacedone)
* Issue #18