kseebaldt/deferred — pull request #29 by wileykestner (2014-11-28 02:47:57+00:00)
Title: Added the ability to cancel a promise

Objects which create promises now add themselves to a list of weakly
retained KSCancelable objects on the child promise. If the owner of
a KSPromise calls `cancel` on the promise, the promise will
iteratively call `cancel` on all of the objects in
its own list (which will in turn force them to call their own
cancelable objects).

The net effect is that calling cancel on a promise will mark it as
cancelled, mark all of its parent promises as cancelled, and will
cause an optional `cancelBlock` to run on all deferreds associated
with the cancelled promises.

This commit pended out a spec which was failing in the head of
kseebaldt/deferred/master for me when I ran it in XCode 6.1.
It looks like there might be a variety of other ways to test it,
but I wanted to get feedback on the cancel proposal and make sure
it was failing for others before I fixed it.