Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

'Cancel' for PromiseKit #9

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

dougzilla32
Copy link

These are the diffs for option 1 of Proposal for PromiseKit cancellation support #896. With option 1 the new cancellation code is included with CorePromise.

There repositories involved with the pull request for option 1 are:

Repositories
mxcl/PromiseKit
PromiseKit/Alamofire-
PromiseKit/Bolts
PromiseKit/CoreLocation
PromiseKit/Foundation
PromiseKit/MapKit
PromiseKit/OMGHTTPURLRQ-
PromiseKit/StoreKit
PromiseKit/SystemConfiguration
PromiseKit/UIKit

…eKit dependencies for all extensions to temporarily point at the PromiseKit branch containing the cancellable classes
    * Delete CancellableGuarantee and all its usages
    * In PromiseKit Core: instead of using additional functions and methods with the 'CC' suffix, created a new 'cancellable' function to wrap any Promise or Guarantee
    * In the extensions: Rename methods with 'CC' suffix to 'cancellable' prefix (may revisit this)
    * Fix the CancellableCatchable 'recover' methods to properly handle cancellation errors
    * Added an 'afterTask' property to Guarantee, to keep track of the task for calls to 'after'. This way the timer can be appropriately cancelled if the returned Guarantee is passed to the new 'cancellable' function. (may revisit this)
    * Update all cancellable tests for the cancellable API changes
…s to point at the latest version of the PromiseKit 'CoreCancel' branch
* Eliminate duplicate code in the cancellable extensions
* When using the 'cancellable' function with the extensions, ensure that the underlying task (if any) is always cancelled
* When using the 'cancellable' function, call 'reject' on the underlying promise (wherever possible) if 'cancel' is invoked
* Create cancellable wrappers for the extensions only for the cases where there is an underlying task that supports cancellation
* update extensions to point at the latest version of PromiseKit in the pull request
* fix "generic parameter 'T' could not be inferred" compilation errors when using the new 'Promise' initializer that takes a cancellable task
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant