diff --git a/docs/Enums.html b/docs/Enums.html
index c048864..8b08a7b 100644
--- a/docs/Enums.html
+++ b/docs/Enums.html
@@ -14,7 +14,7 @@
Tomorrowland 1.3.0 Docs (100% documented) Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
The returned Promise
will always resolve with the same value that its receiver does, but
it won’t affect the timing of any of the receiver’s other observers and it won’t affect
-automatic cancellation propagation behavior.
Promise
does nothing.
tap().always(on:token:_:)
behaves the same as tap(on:token:_:)
except it returns a new
Promise
whereas tap(on:token:_:)
returns the receiver and can be inserted into any
@@ -1731,6 +1732,16 @@
Registers a callback that will be invoked when the promise is cancelled.
+Note
+Like tap
, onCancel
does not prevent automatic cancellation propagation if the
+parent has multiple children and all other children have requested cancellation. Unlike
+tap
, requesting cancellation of onCancel
will cancel the parent if the parent has no
+other children. onCancel
‘s behavior differs from the other standard obsrevers here as
+attaching an onCancel
observer to a promise that would otherwise be cancelled should not
+prevent the cancellation.
The intent of this method is to allow you to deduplicate requests for a long-lived resource (such as a network load) without preventing cancellation of the load in the event that no children care about it anymore.
+Important
+Do not give the returned promise directly to callers. Instead always hand back
+a child, such as returned from makeChild
. Otherwise automatic cancellation propagation
+won’t work as expected.
+
+
+ makeChild()
+
+ Returns a promise that adopts the same value as the receiver.
+ +This method is used in order to hand back child promises to callers so that they cannot
+directly request cancellation of a shared parent promise. This is most useful in conjunction
+with propagatingCancellation(on:cancelRequested:)
but could also be used any time a shared
+promise is given to multiple callers.
Swift
+public func makeChild() -> Promise<Value, Error>
+
+ A new promise that will resolve to the same value as the receiver.
+
@@ -3390,7 +3444,7 @@ Return Value
diff --git a/docs/Structs/Promise/Resolver.html b/docs/Structs/Promise/Resolver.html
index e4217c7..ee9f9a4 100644
--- a/docs/Structs/Promise/Resolver.html
+++ b/docs/Structs/Promise/Resolver.html
@@ -14,7 +14,7 @@
- Tomorrowland 1.3.0 Docs (100% documented)
+ Tomorrowland 1.4.0 Docs (100% documented)
@@ -261,8 +261,9 @@ Declaration
Otherwise the receiver will wait until promise
is resolved and resolve to the same
result.
-If the receiver is cancelled, it will also propagate the cancellation to promise
. If
-this is not desired, then either use resolve(with: promise.ignoringCancel())
or
+
If the receiver is cancelled, it will also propagate the cancellation to promise
the
+same way that a child promise does. If this is not desired, then either use
+resolve(with: promise.ignoringCancel())
or
promise.always(on: .immediate, resolver.resolve(with:))
.
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
The returned Promise
will always resolve with the same value that its receiver does, but
it won’t affect the timing of any of the receiver’s other observers and it won’t affect
-automatic cancellation propagation behavior.
Promise
does nothing.
tap().always(on:token:_:)
behaves the same as tap(on:token:_:)
except it returns a new
Promise
whereas tap(on:token:_:)
returns the receiver and can be inserted into any
@@ -1731,6 +1732,16 @@
Registers a callback that will be invoked when the promise is cancelled.
+Note
+Like tap
, onCancel
does not prevent automatic cancellation propagation if the
+parent has multiple children and all other children have requested cancellation. Unlike
+tap
, requesting cancellation of onCancel
will cancel the parent if the parent has no
+other children. onCancel
‘s behavior differs from the other standard obsrevers here as
+attaching an onCancel
observer to a promise that would otherwise be cancelled should not
+prevent the cancellation.
The intent of this method is to allow you to deduplicate requests for a long-lived resource (such as a network load) without preventing cancellation of the load in the event that no children care about it anymore.
+Important
+Do not give the returned promise directly to callers. Instead always hand back
+a child, such as returned from makeChild
. Otherwise automatic cancellation propagation
+won’t work as expected.
+
+
+ makeChild()
+
+ Returns a promise that adopts the same value as the receiver.
+ +This method is used in order to hand back child promises to callers so that they cannot
+directly request cancellation of a shared parent promise. This is most useful in conjunction
+with propagatingCancellation(on:cancelRequested:)
but could also be used any time a shared
+promise is given to multiple callers.
Swift
+public func makeChild() -> Promise<Value, Error>
+
+ A new promise that will resolve to the same value as the receiver.
+
@@ -3390,7 +3444,7 @@ Return Value
diff --git a/docs/docsets/Tomorrowland.docset/Contents/Resources/Documents/Structs/Promise/Resolver.html b/docs/docsets/Tomorrowland.docset/Contents/Resources/Documents/Structs/Promise/Resolver.html
index e4217c7..ee9f9a4 100644
--- a/docs/docsets/Tomorrowland.docset/Contents/Resources/Documents/Structs/Promise/Resolver.html
+++ b/docs/docsets/Tomorrowland.docset/Contents/Resources/Documents/Structs/Promise/Resolver.html
@@ -14,7 +14,7 @@
- Tomorrowland 1.3.0 Docs (100% documented)
+ Tomorrowland 1.4.0 Docs (100% documented)
@@ -261,8 +261,9 @@ Declaration
Otherwise the receiver will wait until promise
is resolved and resolve to the same
result.
-If the receiver is cancelled, it will also propagate the cancellation to promise
. If
-this is not desired, then either use resolve(with: promise.ignoringCancel())
or
+
If the receiver is cancelled, it will also propagate the cancellation to promise
the
+same way that a child promise does. If this is not desired, then either use
+resolve(with: promise.ignoringCancel())
or
promise.always(on: .immediate, resolver.resolve(with:))
.
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland 1.3.0 Docs (100% documented)
+Tomorrowland 1.4.0 Docs (100% documented)
Tomorrowland is an implementation of Promises for Swift and Objective-C. A Promise is a wrapper around an -asynchronous task that provides a standard way of subscribing to task resolution as well as chaining promises together.
+Tomorrowland is an implementation of Promises for Swift and Objective-C. A Promise is a wrapper around an asynchronous task that provides a standard way of subscribing to task resolution as well as chaining promises together.
UIApplication.shared.isNetworkActivityIndicatorVisible = true
MyAPI.requestFeed(for: user).then { (feedItems) in
self.refreshUI(with: feedItems)
@@ -138,18 +137,11 @@ Tomorrowland
- It uses atomics internally instead of creating a separate
DispatchQueue
for each promise. This means it’s faster and uses fewer resources.
-- It provides full support for cancellable promises. PromiseKit supports detection of “cancelled” errors but has no way to request cancellation of a promise. Hydra
-supports cancelling a promise, but it can’t actually stop any work being done by the promise unless the promise body itself polls for the cancellation status (so e.g.
-a promise wrapping a network task can’t reasonably cancel the network task). Tomorrowland improves on this by allowing the promise body to observe the
-cancelled state, and allows linking cancellation of a child promise to its parent.
+- It provides full support for cancellable promises. PromiseKit supports detection of “cancelled” errors but has no way to request cancellation of a promise. Hydra supports cancelling a promise, but it can’t actually stop any work being done by the promise unless the promise body itself polls for the cancellation status (so e.g. a promise wrapping a network task can’t reasonably cancel the network task). Tomorrowland improves on this by allowing the promise body to observe the cancelled state, and allows linking cancellation of a child promise to its parent.
- Its Obj-C support makes use of generics for improved type safety and better documentation.
-- Like Hydra but unlike PromiseKit, it provides a way to suppress a registered callback (e.g. because you don’t care about the result anymore and don’t want stale
-data affecting your UI). This is distinct from promise cancellation.
-- Tomorrowland promises are fully generic over the error type, whereas both PromiseKit and Hydra only support using
Error
as the error type. This may result in
-more typing to construct a promise but it allows for much more powerful error handling. Tomorrowland also has some affordances for working with promises that
-use Error
as the error type.
-- Tomorrowland is fully thread-safe. I have no reason to believe PromiseKit isn’t, but (at the time of this writing) there are parts of Hydra that are incorrectly
-implemented in a non-thread-safe manner.
+- Like Hydra but unlike PromiseKit, it provides a way to suppress a registered callback (e.g. because you don’t care about the result anymore and don’t want stale data affecting your UI). This is distinct from promise cancellation.
+- Tomorrowland promises are fully generic over the error type, whereas both PromiseKit and Hydra only support using
Error
as the error type. This may result in more typing to construct a promise but it allows for much more powerful error handling. Tomorrowland also has some affordances for working with promises that use Error
as the error type.
+- Tomorrowland is fully thread-safe. I have no reason to believe PromiseKit isn’t, but (at the time of this writing) there are parts of Hydra that are incorrectly implemented in a non-thread-safe manner.
Installation
Manually
@@ -159,18 +151,15 @@ Carthage
github "lilyball/Tomorrowland" ~> 1.0
-The project file is configured to use Swift 5. The code can be compiled against Swift 4.2 instead, but I’m not aware of any way to instruct Carthage to override the
-swift version during compilation.
+The project file is configured to use Swift 5. The code can be compiled against Swift 4.2 instead, but I’m not aware of any way to instruct Carthage to override the swift version during compilation.
CocoaPods
pod 'Tomorrowland', '~> 1.0'
-The podspec declares support for both Swift 4.2 and Swift 5.0, but selecting the Swift version requires using CoocaPods 1.7.0 or later. When using CocoaPods 1.6
-or earlier the Swift version will default to 5.0.
+The podspec declares support for both Swift 4.2 and Swift 5.0, but selecting the Swift version requires using CoocaPods 1.7.0 or later. When using CocoaPods 1.6 or earlier the Swift version will default to 5.0.
SwiftPM
-Tomorrowland currently relies on a private Obj-C module for its atomics. This arrangement means it is not compatible with Swift Package Manager (as adding
-compatibility would necessitate publicly exposing the private Obj-C module).
+Tomorrowland currently relies on a private Obj-C module for its atomics. This arrangement means it is not compatible with Swift Package Manager (as adding compatibility would necessitate publicly exposing the private Obj-C module).
Usage
Creating Promises
@@ -181,18 +170,11 @@ Creating Promises
})
-The body of this promise runs on the specified PromiseContext
, which in this case is .utility
(which means DispatchQueue.global(qos: .utility)
).
-Unlike callbacks, all created promises must specify a context, so as to avoid accidentally running expensive computations on the main thread. The available contexts
-include .main
, every Dispatch QoS, a specific DispatchQueue
, a specific OperationQueue
, or the value .immediate
which means to run the block
-synchronously. There’s also the special context .auto
, which evaluates to .main
on the main thread and .default
otherwise.
The body of this promise runs on the specified PromiseContext
, which in this case is .utility
(which means DispatchQueue.global(qos: .utility)
). Unlike callbacks, all created promises must specify a context, so as to avoid accidentally running expensive computations on the main thread. The available contexts include .main
, every Dispatch QoS, a specific DispatchQueue
, a specific OperationQueue
, or the value .immediate
which means to run the block synchronously. There’s also the special context .auto
, which evaluates to .main
on the main thread and .default
otherwise.
Note: The .immediate
context can be dangerous to use for callback handlers and should be avoided in most cases. It’s primarily intended for creating
-promises, and whenever it’s used with a callback handler the handler must be prepared to execute on any thread. For callbacks it’s usually only useful for short
-thread-agnostic callbacks, such as an .onRequestCancel
that does nothing more than cancelling a URLSessionTask
.
Note: The .immediate
context can be dangerous to use for callback handlers and should be avoided in most cases. It’s primarily intended for creating promises, and whenever it’s used with a callback handler the handler must be prepared to execute on any thread. For callbacks it’s usually only useful for short thread-agnostic callbacks, such as an .onRequestCancel
that does nothing more than cancelling a URLSessionTask
.
The body of a Promise
receives a “resolver”, which it must use to fulfill, reject, or cancel the promise. If the resolver goes out of scope without being used, the
-promise is automatically cancelled. If the promise’s error type is Error
, the promise body may also throw an error (as seen above), which is then used to reject the
-promise. This resolver can also be used to observe cancellation requests using resolver.onRequestCancel
, as seen here:
The body of a Promise
receives a “resolver”, which it must use to fulfill, reject, or cancel the promise. If the resolver goes out of scope without being used, the promise is automatically cancelled. If the promise’s error type is Error
, the promise body may also throw an error (as seen above), which is then used to reject the promise. This resolver can also be used to observe cancellation requests using resolver.onRequestCancel
, as seen here:
let promise = Promise<Data,Error>(on: .immediate, { (resolver) in
let task = urlSession.dataTask(with: url, completionHandler: { (data, response, error) in
if let data = data {
@@ -210,24 +192,16 @@ Creating Promises
})
-Resolvers also have a convenience method handleCallback()
that is intended to make it easy to wrap framework callbacks in promises. This method returns a
-closure that can be used as a callback directly. It also takes an optional isCancelError
parameter that can be used to indicate when an error represents
-cancellation. For example:
Resolvers also have a convenience method handleCallback()
that is intended to make it easy to wrap framework callbacks in promises. This method returns a closure that can be used as a callback directly. It also takes an optional isCancelError
parameter that can be used to indicate when an error represents cancellation. For example:
geocoder.reverseGeocodeLocation(location, completionHandler: resolver.handleCallback(isCancelError: { CLError.geocodeCanceled ~= $0 }))
Once you have a promise, you can register callbacks to be executed when the promise is resolved. Most callback methods require a context, but for some of them
-(then
, catch
, always
, and tryThen
) you can omit the context and it will default to .auto
, which means the main thread if the callback is registered from the
-main thread, otherwise the dispatch queue with QoS .default
.
Once you have a promise, you can register callbacks to be executed when the promise is resolved. Most callback methods require a context, but for some of them (then
, catch
, always
, and tryThen
) you can omit the context and it will default to .auto
, which means the main thread if the callback is registered from the main thread, otherwise the dispatch queue with QoS .default
.
When you register a callback, the method also returns a Promise
. All callback registration methods return a new Promise
even if the callback doesn’t affect the
-value of the promise. The reason for this is so chained callbacks always guarantee that the previous callback finished executing before the new one starts, even
-when using concurrent contexts (e.g. .utility
), and so cancelling the returned promise doesn’t cancel the original one if any other callbacks were registered on
-it.
When you register a callback, the method also returns a Promise
. All callback registration methods return a new Promise
even if the callback doesn’t affect the value of the promise. The reason for this is so chained callbacks always guarantee that the previous callback finished executing before the new one starts, even when using concurrent contexts (e.g. .utility
), and so cancelling the returned promise doesn’t cancel the original one if any other callbacks were registered on it.
Most callback registration methods also have versions that allow you to return a Promise
from your callback. In this event, the resulting Promise
waits for the
-promise you returned to resolve before adopting its value. This allows for easy composition of promises.
Most callback registration methods also have versions that allow you to return a Promise
from your callback. In this event, the resulting Promise
waits for the promise you returned to resolve before adopting its value. This allows for easy composition of promises.
showLoadingIndicator()
fetchUserCredentials().flatMap(on: .default) { (credentials) in
// This returns a new promise
@@ -247,25 +221,14 @@ Using Promises
}
-When composing callbacks that return promises, you may run into issues with incompatible error types. There are convenience methods for working with promises
-whose errors are compatible with Error
, but they don’t cover all cases. If you find yourself hitting one of these cases, any Promise
whose error type conforms to
-Error
has a property .upcast
that will convert that error into an Error
to allow for easier composition of promises.
When composing callbacks that return promises, you may run into issues with incompatible error types. There are convenience methods for working with promises whose errors are compatible with Error
, but they don’t cover all cases. If you find yourself hitting one of these cases, any Promise
whose error type conforms to Error
has a property .upcast
that will convert that error into an Error
to allow for easier composition of promises.
Tomorrowland also offers a typealias StdPromise<Value>
as shorthand for Promise<T,Error>
. This is frequently useful to avoid having to repeat the types,
-such as with StdPromise(fulfilled: someValue)
instead of Promise<SomeValue,Error>(fulfilled: someValue)
.
Tomorrowland also offers a typealias StdPromise<Value>
as shorthand for Promise<T,Error>
. This is frequently useful to avoid having to repeat the types, such as with StdPromise(fulfilled: someValue)
instead of Promise<SomeValue,Error>(fulfilled: someValue)
.
All promises expose a method .requestCancel()
. It is named such because this doesn’t actually guarantee that the promise will be cancelled. If the promise
-supports cancellation, this method will trigger a callback that the promise can use to cancel its work. But promises that don’t support cancellation will ignore this
-and will eventually fulfill or reject as normal. Naturally, requesting cancellation of a promise that has already been resolved does nothing, even if the callbacks have
-not yet been invoked.
In order to handle the issue of a promise being resolved after you no longer care about it, there is a separate mechanism called a PromiseInvalidationToken
-that can be used to suppress callbacks. All callback methods have an optional token
parameter that accepts a PromiseInvalidationToken
. If provided,
-calling invalidate()
on the token prior to the callback being executed guarantees the callback will not fire. If the callback returns a value that is required in order
-to resolve the Promise
returned from the callback registration method, the resulting Promise
is cancelled instead. PromiseInvalidationToken
s can be used
-with multiple callbacks at once, and a single token can be re-used as much as desired. It is recommended that you take advantage of both invalidation tokens and
-cancellation. This may look like
All promises expose a method .requestCancel()
. It is named such because this doesn’t actually guarantee that the promise will be cancelled. If the promise supports cancellation, this method will trigger a callback that the promise can use to cancel its work. But promises that don’t support cancellation will ignore this and will eventually fulfill or reject as normal. Naturally, requesting cancellation of a promise that has already been resolved does nothing, even if the callbacks have not yet been invoked.
In order to handle the issue of a promise being resolved after you no longer care about it, there is a separate mechanism called a PromiseInvalidationToken
that can be used to suppress callbacks. All callback methods have an optional token
parameter that accepts a PromiseInvalidationToken
. If provided, calling invalidate()
on the token prior to the callback being executed guarantees the callback will not fire. If the callback returns a value that is required in order to resolve the Promise
returned from the callback registration method, the resulting Promise
is cancelled instead. PromiseInvalidationToken
s can be used with multiple callbacks at once, and a single token can be re-used as much as desired. It is recommended that you take advantage of both invalidation tokens and cancellation. This may look like
class URLImageView: UIImageView {
private var promise: StdPromise<Void>?
private let invalidationToken = PromiseInvalidationToken()
@@ -294,19 +257,11 @@ Cancelling and Invalidation
}
-PromiseInvalidationToken
also has a method .requestCancelOnInvalidate(_:)
that can register any number of Promise
s to be automatically
-requested to cancel (using .requestCancel()
) the next time the token is invalidated. Promise
also has the same method (except it takes a token as the
-argument) as a convenience for calling .requestCancelOnInvalidate(_:)
on the token. This can be used to terminate a promise chain without ever assigning
-the promise to a local variable. PromiseInvalidationToken
also has a method .cancelWithoutInvalidating()
which cancels any associated promises
-without invalidating the token.
PromiseInvalidationToken
also has a method .requestCancelOnInvalidate(_:)
that can register any number of Promise
s to be automatically requested to cancel (using .requestCancel()
) the next time the token is invalidated. Promise
also has the same method (except it takes a token as the argument) as a convenience for calling .requestCancelOnInvalidate(_:)
on the token. This can be used to terminate a promise chain without ever assigning the promise to a local variable. PromiseInvalidationToken
also has a method .cancelWithoutInvalidating()
which cancels any associated promises without invalidating the token.
By default PromiseInvalidationToken
s will invalidate themselves automatically when deinitialized. This is primarily useful in conjunction with
-requestCancelOnInvalidate(_:)
as it allows you to automatically cancel your promises when object that owns the token deinits. This behavior can be
-disabled with an optional parameter to init
.
By default PromiseInvalidationToken
s will invalidate themselves automatically when deinitialized. This is primarily useful in conjunction with requestCancelOnInvalidate(_:)
as it allows you to automatically cancel your promises when object that owns the token deinits. This behavior can be disabled with an optional parameter to init
.
Promise
also has a convenience method requestCancelOnDeinit(_:)
which can be used to request the Promise
to be cancelled when a given object
-deinits. This is equivalent to adding a PromiseInvalidationToken
property to the object (configured to invalidate on deinit) and requesting cancellation when
-the token invalidates, but can be used if the token would otherwise not be explicitly invalidated.
Promise
also has a convenience method requestCancelOnDeinit(_:)
which can be used to request the Promise
to be cancelled when a given object deinits. This is equivalent to adding a PromiseInvalidationToken
property to the object (configured to invalidate on deinit) and requesting cancellation when the token invalidates, but can be used if the token would otherwise not be explicitly invalidated.
Using these methods, the above loadImage(from:)
can be rewritten as the following including cancellation:
class URLImageView: UIImageView {
@@ -336,17 +291,10 @@ Cancelling and Invalidation
PromiseInvalidationToken
s can be arranged in a tree such that invalidating one token will cascade this invalidation down to other tokens. This is
-accomplished by calling childToken.chainInvalidation(from: parentToken)
. Practically speaking this is no different than just manually invalidating each
-child token yourself after invalidating the parent token, but it’s provided as a convenience to make it easy to have fine-grained invalidation control while also having
-a simple way to bulk-invalidate tokens. For example, you might have separate tokens for different view controllers that all chain invalidation from a single token that
-gets invalidated when the user logs out, thus automatically invalidating all your user-dependent network requests at once while still allowing each view controller the
-ability to invalidate just its own requests independently.
PromiseInvalidationToken
s can be arranged in a tree such that invalidating one token will cascade this invalidation down to other tokens. This is accomplished by calling childToken.chainInvalidation(from: parentToken)
. Practically speaking this is no different than just manually invalidating each child token yourself after invalidating the parent token, but it’s provided as a convenience to make it easy to have fine-grained invalidation control while also having a simple way to bulk-invalidate tokens. For example, you might have separate tokens for different view controllers that all chain invalidation from a single token that gets invalidated when the user logs out, thus automatically invalidating all your user-dependent network requests at once while still allowing each view controller the ability to invalidate just its own requests independently.
TokenPromise
In order to avoid the repetition of passing a PromiseInvalidationToken
to multiple Promise
methods as well as cancelling the resulting promise, a type
-TokenPromise
exists that handles this for you. You can create a TokenPromise
with the Promise.withToken(_:)
method. This allows you to take code like
-the following:
In order to avoid the repetition of passing a PromiseInvalidationToken
to multiple Promise
methods as well as cancelling the resulting promise, a type TokenPromise
exists that handles this for you. You can create a TokenPromise
with the Promise.withToken(_:)
method. This allows you to take code like the following:
func loadModel() {
promiseToken.invalidate()
MyModel.fetchFromNetworkAsPromise()
@@ -372,30 +320,16 @@ PromiseInvalidationToken
‘s
-requestCancelOnInvalidate(_:)
if you want to be able to cancel the promise later.
+
Nearly all callback registration methods will automatically propagate cancellation requests from the child to the parent if the parent has no other observers. If all observers for a promise request cancellation, the cancellation request will propagate upwards at this time. This means that a promise will not automatically cancel as long as there’s at least one interested observer. Do note that promises that have no observers do not get automatically cancelled, this only happens if there’s at least one observer (which then requests cancellation). Automatic cancellation propagation also requires that the promise itself no longer be in scope. For this reason you should avoid holding onto promises long-term and instead use the .cancellable
property or PromiseInvalidationToken
‘s requestCancelOnInvalidate(_:)
if you want to be able to cancel the promise later.
-Automatic cancellation propagation also works with the utility functions when(fulfilled:)
and when(first:)
as well as the convenience methods
-timeout(on:delay:)
and delay(on:_:)
.
+Automatic cancellation propagation also works with the utility functions when(fulfilled:)
and when(first:)
as well as the convenience methods timeout(on:delay:)
and delay(on:_:)
.
-Promises have a couple of methods that do not participate in automatic cancellation propagation. You can use tap(on:token:_:)
as an alternative to always
in
-order to register an observer that won’t interfere with the existing automatic cancellation propagation (this is suitable for inserting into the middle of a promise
-chain). You can also use tap()
as a more generic version of this.
+Promises have a couple of methods that do not participate in automatic cancellation propagation. You can use tap(on:token:_:)
as an alternative to always
in order to register an observer that won’t interfere with the existing automatic cancellation propagation (this is suitable for inserting into the middle of a promise chain). You can also use tap()
as a more generic version of this.
Note that ignoringCancel()
disables automatic cancellation propagation on the receiver. Once you invoke this on a promise, it will never automatically cancel.
propagatingCancellation(on:cancelRequested:)
-In some cases you may need to hold onto a promise without blocking cancellation propagation from its children. The primary use-case here is deduplicating access to
-an asynchronous resource (such as a network load). In this scenario you may wish to hold onto a promise and return a new child for every client requesting the same
-resource, without preventing cancellation of the resource load if all clients cancel their requests. This can be accomplished by holding onto the result of calling
-.propagatingCancellation(on:cancelRequested:)
. The promise returned from this method will propagate cancellation to its parent as soon as all children
-have requested cancellation even if the promise is still in scope. When cancellation is requested, the cancelRequested
handler will be invoked immediately prior to
-propagating cancellation upwards; this enables you to release your reference to the promise (so a new request by a client will create a brand new resource load). An
-example of this might look like:
+In some cases you may need to hold onto a promise without blocking cancellation propagation from its children. The primary use-case here is deduplicating access to an asynchronous resource (such as a network load). In this scenario you may wish to hold onto a promise and return a new child for every client requesting the same resource, without preventing cancellation of the resource load if all clients cancel their requests. This can be accomplished by holding onto the result of calling .propagatingCancellation(on:cancelRequested:)
. The promise returned from this method will propagate cancellation to its parent as soon as all children have requested cancellation even if the promise is still in scope. When cancellation is requested, the cancelRequested
handler will be invoked immediately prior to propagating cancellation upwards; this enables you to release your reference to the promise (so a new request by a client will create a brand new resource load). Returning a new child to each client can be done using makeChild()
. An example of this might look like:
func loadResource(at url: URL) {
let promise: StdPromise<Model>
if let existingPromise = resourceLoads[url] {
@@ -409,24 +343,16 @@ resourceLoads[url] = promise
}
// Return a new child for each request so all clients have to cancel, not just one.
- return promise.then(on: .immediate, { _ in })
+ return promise.makeChild()
}
The special .nowOr(_:)
context
-There is a special context PromiseContext.nowOr(_:)
that behaves a bit differently than other contexts. This context is special in that its callback executes
-differently depending on whether the promise it’s being registered on has already resolved by the time the callback is registered. If the promise has already
-resolved then .nowOr(context)
behaves like .immediate
, otherwise it behaves like the wrapped context
. This context is intended to be used to replace
-code that would otherwise check if the promise.result
is non-nil
prior to registering a callback.
+There is a special context PromiseContext.nowOr(_:)
that behaves a bit differently than other contexts. This context is special in that its callback executes differently depending on whether the promise it’s being registered on has already resolved by the time the callback is registered. If the promise has already resolved then .nowOr(context)
behaves like .immediate
, otherwise it behaves like the wrapped context
. This context is intended to be used to replace code that would otherwise check if the promise.result
is non-nil
prior to registering a callback.
-If this context is used in Promise.init(on:_:)
it always behaves like .immediate
, and if it’s used in DelayedPromise.init(on:_:)
it always behaves
-like the wrapped context.
+If this context is used in Promise.init(on:_:)
it always behaves like .immediate
, and if it’s used in DelayedPromise.init(on:_:)
it always behaves like the wrapped context.
-There is a property PromiseContext.isExecutingNow
that can be accessed from within a callback registered with .nowOr(_:)
to determine if the callback
-is executing synchronously or asynchronously. When accessed from any other context it returns false
. When registering a callback with .immediate
from
-within a callback where PromiseContext.isExecutingNow
is true
, the nested callback will inherit the PromiseContext.isExecutingNow
flag if and only
-if the nested callback is also executing synchronously. This is a bit subtle but is intended to allow Promise(on: .immediate, { … })
to inherit the flag from
-its surrounding scope.
+There is a property PromiseContext.isExecutingNow
that can be accessed from within a callback registered with .nowOr(_:)
to determine if the callback is executing synchronously or asynchronously. When accessed from any other context it returns false
. When registering a callback with .immediate
from within a callback where PromiseContext.isExecutingNow
is true
, the nested callback will inherit the PromiseContext.isExecutingNow
flag if and only if the nested callback is also executing synchronously. This is a bit subtle but is intended to allow Promise(on: .immediate, { … })
to inherit the flag from its surrounding scope.
An example of how this context might be used is when populating an image view from a network request:
createNetworkRequestAsPromise()
@@ -445,41 +371,28 @@ Promise Helpers
There are a few helper functions that can be used to deal with multiple promises.
when(fulfilled:)
-when(fulfilled:)
is a global function that takes either an array of promises or 2–6 promises as separate arguments, and returns a single promise that is
-eventually fulfilled with the values of all input promises. With the array version all input promises must have the same type and the result is fulfilled with an array.
-With the separate argument version the promises may have unique value types (but the same error type) and the result is fulfilled with a tuple.
+when(fulfilled:)
is a global function that takes either an array of promises or 2–6 promises as separate arguments, and returns a single promise that is eventually fulfilled with the values of all input promises. With the array version all input promises must have the same type and the result is fulfilled with an array. With the separate argument version the promises may have unique value types (but the same error type) and the result is fulfilled with a tuple.
-If any of the input promises is rejected or cancelled, the resulting promise is immediately rejected or cancelled as well. If multiple input promises are rejected or
-cancelled, the first such one affects the result.
+If any of the input promises is rejected or cancelled, the resulting promise is immediately rejected or cancelled as well. If multiple input promises are rejected or cancelled, the first such one affects the result.
This function has an optional parameter cancelOnFailure:
that, if provided as true
, will cancel all input promises if any of them are rejected.
when(first:)
-when(first:)
is a global function that takes an array of promises of the same type, and returns a single promise that eventually adopts the same value or error as
-the first input promise that gets fulfilled or rejected. Cancelled input promises are ignored, unless all input promsies are cancelled, at which point the resulting
-promise will be cancelled as well.
+when(first:)
is a global function that takes an array of promises of the same type, and returns a single promise that eventually adopts the same value or error as the first input promise that gets fulfilled or rejected. Cancelled input promises are ignored, unless all input promsies are cancelled, at which point the resulting promise will be cancelled as well.
-This function has an optional parameter cancelRemaining:
that, if provided as true
, will cancel the remaining input promises as soon as one of them is fulfilled
-or rejected.
+This function has an optional parameter cancelRemaining:
that, if provided as true
, will cancel the remaining input promises as soon as one of them is fulfilled or rejected.
Promise.timeout(on:delay:)
-Promise.timeout(on:delay:)
is a method that returns a new promise that adopts the same value as the receiver, or is rejected with an error if the receiver isn’t
-resolved within the given interval.
+Promise.timeout(on:delay:)
is a method that returns a new promise that adopts the same value as the receiver, or is rejected with an error if the receiver isn’t resolved within the given interval.
Promise.delay(on:_:)
-Promise.delay(on:_:)
is a method that returns a new promise that adopts the same result as the receiver after the specified delay. It is intended primarily for
-testing purposes.
+Promise.delay(on:_:)
is a method that returns a new promise that adopts the same result as the receiver after the specified delay. It is intended primarily for testing purposes.
Objective-C
-Tomorrowland has Obj-C compatibility in the form of TWLPromise<ValueType,ErrorType>
. This is a parallel promise implementation that can be bridged to/from
-Promise
and supports all of the same functionality. Note that some of the method names are different (due to lack of overloading), and while TWLPromise
is
-generic over its types, the return values of callback registration methods that return new promises are not parameterized (due to inability to have generic methods).
+Tomorrowland has Obj-C compatibility in the form of TWLPromise<ValueType,ErrorType>
. This is a parallel promise implementation that can be bridged to/from Promise
and supports all of the same functionality. Note that some of the method names are different (due to lack of overloading), and while TWLPromise
is generic over its types, the return values of callback registration methods that return new promises are not parameterized (due to inability to have generic methods).
Callback lifetimes
-Callbacks registered on promises will be retained until the promise is resolved. If a callback is invoked (or would be invoked if the relevant invalidation token hadn’t
-been invalidated), Tomorrowland guarantees that it will release the callback on the context it was invoked on. If the callback is not invoked (e.g. it’s a then(on:_:)
-callback but the promise was rejected) then no guarantees are made as to the context the callback is released on. If you need to ensure it’s released on the
-appropriate context (e.g. if it captures an object that must deallocate on the main thread) then you can use .always
or one of the .mapResult
variants.
+Callbacks registered on promises will be retained until the promise is resolved. If a callback is invoked (or would be invoked if the relevant invalidation token hadn’t been invalidated), Tomorrowland guarantees that it will release the callback on the context it was invoked on. If the callback is not invoked (e.g. it’s a then(on:_:)
callback but the promise was rejected) then no guarantees are made as to the context the callback is released on. If you need to ensure it’s released on the appropriate context (e.g. if it captures an object that must deallocate on the main thread) then you can use .always
or one of the .mapResult
variants.
Requirements
Requires a minimum of iOS 9, macOS 10.10, watchOS 2.0, or tvOS 9.0.
@@ -497,25 +410,32 @@ Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.
Version History
+v1.4.0
+
+
+- Fix the cancellation propagation behavior of
Promise.Resolver.resolve(with:)
and the flatMap
family of methods. Previously, requesting cancellation of the promise associated with the resolver (for resolve(with:)
, or the returned promise for the flatMap
family) would immediately request cancellation of the upstream promise even if the upstream promise had other children. The new behavior fixes this such that it participates in automatic cancellation propagation just like any other child promise (#54).
+- Slightly optimize stack usage when chaining one promise to another.
+- Avoid using stack space for chained promises that don’t involve a callback. For example, when the promise returned from a
flatMap(on:token:_:)
resolves it will resolve the outer promise without using additional stack frames. You can think of it like tail calling functions. This affects not just flatMap
but also operations such as tap()
, ignoringCancel()
, and more. This also applies to Obj-C (with TWLPromise
).
+
+
+Note: This does not affect the variants that implicitly upcast from some E: Swift.Error
to Swift.Error
such as tryFlatMap(on:token:_:)
.
+
+
+- Change cancellation propagation behavior of
onCancel
. Like tap
, it doesn’t prevent automatic cancellation propagation if the parent has other children and all other children request cancellation. Unlike tap
, requesting cancellation of onCancel
when there are no other children will propagate cancellation to the parent. The motivation here is attaching an onCancel
observer shouldn’t prevent cancellation that would otherwise occur, but when it’s the only child it should behave like the other standard observers (#57).
+- Add method
Promise.makeChild()
. This returns a new child of the receiver that adopts the receiver’s value and propagates cancellation like any other observer. The purpose here is to be used when handing back multiple children of one parent to callers, as handing back the parent means any one caller can cancel it without the other callers’ participation. This is particularly useful in conjunction with propagatingCancellation(on:cancelRequested:)
(#56).
+
v1.3.0
-- Add
PromiseContext.isExecutingNow
(TWLPromiseContext.isExecutingNow
in Obj-C) that returns true
if accessed from within a callback registered
-with .nowOr(_:)
and executing synchronously, or false
otherwise. If accessed from within a callback (or Promise.init(on:_:)
) registered with
-.immediate
and running synchronously, it inherits the surrounding scope’s PromiseContext.isExecutingNow
flag. This is intended to allow
-Promise(on: .immediate, { … })
to query the surrounding scope’s flag (#53).
+- Add
PromiseContext.isExecutingNow
(TWLPromiseContext.isExecutingNow
in Obj-C) that returns true
if accessed from within a callback registered with .nowOr(_:)
and executing synchronously, or false
otherwise. If accessed from within a callback (or Promise.init(on:_:)
) registered with .immediate
and running synchronously, it inherits the surrounding scope’s PromiseContext.isExecutingNow
flag. This is intended to allow Promise(on: .immediate, { … })
to query the surrounding scope’s flag (#53).
- Add convenience methods to Obj-C for doing then+catch together, as this is a common pattern and chaining Obj-C methods is a little awkward (#45).
-- Change
Promise.timeout
’s default context to .nowOr(.auto)
for the Error
overload as well.
-- Change the behavior of
Promise.timeout(on:delay:)
when the delay
is less than or equal to zero, the context
is .immediate
or .nowOr(_:)
, and the
-upstream promise hasn’t resolved yet. Previously the timeout would occur asynchronously and the upstream promise would get a chance to race the timeout. With
-the new behavior the timeout occurs synchronously (#49).
+- Change
Promise.timeout
‘s default context to .nowOr(.auto)
for the Error
overload as well.
+- Change the behavior of
Promise.timeout(on:delay:)
when the delay
is less than or equal to zero, the context
is .immediate
or .nowOr(_:)
, and the upstream promise hasn’t resolved yet. Previously the timeout would occur asynchronously and the upstream promise would get a chance to race the timeout. With the new behavior the timeout occurs synchronously (#49).
v1.2.0
-- Add
PromiseContext.nowOr(context)
(+[TWLContext nowOrContext:]
in Obj-C) that runs the callback synchronously when registered if the promise
-has already resolved, otherwise registers the callback to run on context
. This can be used to replace code that previously would have required checking
-promise.result
prior to registering the callback (#34).
+- Add
PromiseContext.nowOr(context)
(+[TWLContext nowOrContext:]
in Obj-C) that runs the callback synchronously when registered if the promise has already resolved, otherwise registers the callback to run on context
. This can be used to replace code that previously would have required checking promise.result
prior to registering the callback (#34).
For example:
@@ -525,30 +445,20 @@ v1.2.0
-- Add
Promise.Resolver.hasRequestedCancel
(TWLResolver.cancelRequested
in Obj-C) that returns true
if the promise has been requested to
-cancel or is already cancelled, or false
if it hasn’t been requested to cancel or is fulfilled or rejected. This can be used when a promise initializer takes
-significant time in a manner not easily interrupted by an onRequestCancel
handler (#47).
-- Change
Promise.timeout
’s default context from .auto
to .nowOr(.auto)
. This behaves the same as .auto
in most cases, except if the receiver has
-already been resolved this will cause the returned promise to likewise already be resolved (#50).
-- Ensure
when(first:cancelRemaining:)
returns an already-cancelled promise if all input promises were previously cancelled, instead of cancelling the
-returned promise asynchronously (#51).
-- Ensure
when(fulfilled:qos:cancelOnFailure:)
returns an already-resolved promise if either all input promises were previously fulfliled or any input
-promise was previously rejected or cancelled (#52).
+- Add
Promise.Resolver.hasRequestedCancel
(TWLResolver.cancelRequested
in Obj-C) that returns true
if the promise has been requested to cancel or is already cancelled, or false
if it hasn’t been requested to cancel or is fulfilled or rejected. This can be used when a promise initializer takes significant time in a manner not easily interrupted by an onRequestCancel
handler (#47).
+- Change
Promise.timeout
’s default context from .auto
to .nowOr(.auto)
. This behaves the same as .auto
in most cases, except if the receiver has already been resolved this will cause the returned promise to likewise already be resolved (#50).
+- Ensure
when(first:cancelRemaining:)
returns an already-cancelled promise if all input promises were previously cancelled, instead of cancelling the returned promise asynchronously (#51).
+- Ensure
when(fulfilled:qos:cancelOnFailure:)
returns an already-resolved promise if either all input promises were previously fulfliled or any input promise was previously rejected or cancelled (#52).
v1.1.1
-- Fix memory leaks in
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
and
-PromiseInvalidationToken.chainInvalidation(from:includingCancelWithoutInvalidating:)
when cleaning up nil
nodes prior to pushing on the
-new node (#48).
+- Fix memory leaks in
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
and PromiseInvalidationToken.chainInvalidation(from:includingCancelWithoutInvalidating:)
when cleaning up nil
nodes prior to pushing on the new node (#48).
v1.1.0
-- Add new method
.propagatingCancellation(on:cancelRequested:)
that can be used to create a long-lived promise that propagates cancellation from its
-children to its parent while it’s still alive. Normally promises don’t propagate cancellation until they themselves are released, in case more children are going to be
-added. This new method is intended to be used when deduplicating requests for an asynchronous resource (such as a network load) such that the resource request
-can be cancelled in the event that no children care about it anymore (#46).
+- Add new method
.propagatingCancellation(on:cancelRequested:)
that can be used to create a long-lived promise that propagates cancellation from its children to its parent while it’s still alive. Normally promises don’t propagate cancellation until they themselves are released, in case more children are going to be added. This new method is intended to be used when deduplicating requests for an asynchronous resource (such as a network load) such that the resource request can be cancelled in the event that no children care about it anymore (#46).
v1.0.1
@@ -558,27 +468,18 @@ v1.0.1
v1.0.0
-- Fix a rather serious bug where
PromiseInvalidationToken
s would not deinit as long as any promise whose callback was tied to the token was still unresolved.
-This meant that the default invalidateOnDeinit
behavior would not trigger and the callback would still fire even though there were no more external references
-to the token, and this meant any promises configured to be cancelled when the promise invalidated would not cancel. Tokens used purely for
-requestCancelOnInvalidate(_:)
would still deallocate, and tokens would still deallocate after any associated promises had resolved.
-- Tweak the atomic memory ordering used in
PromiseInvalidationToken
s. After a careful re-reading I don’t believe I was issuing the correct fences previously,
-making it possible for tokens whose associated promise callbacks were executing concurrently with a call to requestCancelOnInvalidate(_:)
to read the
-wrong generation value, and for tokens that had requestCancelOnInvalidate(_:)
invoked concurrently on multiple threads to corrupt the generation.
-- Add
PromiseInvalidationToken.chainInvalidation(from:)
to invalidate a token whenever another token invalidates. This allows for building a tree of
-tokens in order to have both fine-grained and bulk invalidation at the same time. Tokens chained together this way stay chained forever (#43).
-- Update project file to Swift 5.0. The source already supported this. This change should only affect people using Carthage or anyone adding building this
-framework from source.
-- Update the podspec to list both Swift 4.2 and Swift 5.0. With CocoaPods 1.7.0 or later your
Podfile
can now declare which version of Swift it’s compatible with.
-For anyone using CocoaPods 1.6 or earlier it will default to Swift 5.0.
+- Fix a rather serious bug where
PromiseInvalidationToken
s would not deinit as long as any promise whose callback was tied to the token was still unresolved. This meant that the default invalidateOnDeinit
behavior would not trigger and the callback would still fire even though there were no more external references to the token, and this meant any promises configured to be cancelled when the promise invalidated would not cancel. Tokens used purely for requestCancelOnInvalidate(_:)
would still deallocate, and tokens would still deallocate after any associated promises had resolved.
+- Tweak the atomic memory ordering used in
PromiseInvalidationToken
s. After a careful re-reading I don’t believe I was issuing the correct fences previously, making it possible for tokens whose associated promise callbacks were executing concurrently with a call to requestCancelOnInvalidate(_:)
to read the wrong generation value, and for tokens that had requestCancelOnInvalidate(_:)
invoked concurrently on multiple threads to corrupt the generation.
+- Add
PromiseInvalidationToken.chainInvalidation(from:)
to invalidate a token whenever another token invalidates. This allows for building a tree of tokens in order to have both fine-grained and bulk invalidation at the same time. Tokens chained together this way stay chained forever (#43).
+- Update project file to Swift 5.0. The source already supported this. This change should only affect people using Carthage or anyone adding building this framework from source.
+- Update the podspec to list both Swift 4.2 and Swift 5.0. With CocoaPods 1.7.0 or later your
Podfile
can now declare which version of Swift it’s compatible with. For anyone using CocoaPods 1.6 or earlier it will default to Swift 5.0.
v0.6.0
- Make
DelayedPromise
conform to Equatable
(#37).
- Add convenience functions for working with
Swift.Result
(#39).
-- Mark all the deprecated functions as unavailable instead. This restores the ability to write code like
promise.then({ foo?($0) })
without it incorrectly
-resolving to the deprecated form of map(_:)
(#35).
+- Mark all the deprecated functions as unavailable instead. This restores the ability to write code like
promise.then({ foo?($0) })
without it incorrectly resolving to the deprecated form of map(_:)
(#35).
- Rename
Promise.init(result:)
and Promise.init(on:result:after:)
to Promise.init(with:)
and Promise.init(on:with:after:)
(#40).
v0.5.1
@@ -588,28 +489,23 @@ v0.5.1
Ensure that if a user-supplied callback is invoked, it is also released on the context where it was invoked (#38).
-This guarantee is only made for callbacks that are invoked (ignoring tokens). What this means is when using e.g. .then(on:_:)
if the promise is fulfilled, the
- onSuccess
block will be released on the provided context, but if the promise is rejected no such guarantee is made. If you rely on the context it’s released on
- (e.g. it captures an object that must deallocate on the main thread) then you can use .always
or one of the mapResult
variants.
+This guarantee is only made for callbacks that are invoked (ignoring tokens). What this means is when using e.g. .then(on:_:)
if the promise is fulfilled, the onSuccess
block will be released on the provided context, but if the promise is rejected no such guarantee is made. If you rely on the context it’s released on (e.g. it captures an object that must deallocate on the main thread) then you can use .always
or one of the mapResult
variants.
v0.5.0
- Rename a lot of methods on
Promise
and TokenPromise
(#5).
-This gets rid of most overrides, leaving the only overridden methods to be ones that handle either Swift.Error
or E: Swift.Error
, and even these overrides
- are removed in the Swift 5 compiler.
+This gets rid of most overrides, leaving the only overridden methods to be ones that handle either Swift.Error
or E: Swift.Error
, and even these overrides are removed in the Swift 5 compiler.
-then
is now map
or flatMap
, recover
’s override is now flatMapError
, always
’s override is now flatMapResult
, and similar renames were made for
- the try
variants.
+then
is now map
or flatMap
, recover
’s override is now flatMapError
, always
’s override is now flatMapResult
, and similar renames were made for the try
variants.
- Add a new
then
method whose block returns Void
. The returned promise resolves to the same result as the original promise.
- Add new
mapError
and tryMapError
methods.
- Add new
mapResult
and tryMapResult
methods.
- Extend
tryFlatMapError
to be available on all Promise
s instead of just those whose error type is Swift.Error
.
-- Remove the default
.auto
value for the on context:
parameter to most calls. It’s now only provided for the “terminal” callbacks, the ones that don’t return a
-value from the handler. This avoids the common problem of running trivial maps on the main thread unnecessarily (#33).
+- Remove the default
.auto
value for the on context:
parameter to most calls. It’s now only provided for the “terminal” callbacks, the ones that don’t return a value from the handler. This avoids the common problem of running trivial maps on the main thread unnecessarily (#33).
v0.4.3
@@ -629,23 +525,16 @@ v0.4.1
v0.4
-- Improve the behavior of
.delay(on:_:)
and .timeout(on:delay:)
when using PromiseContext.operationQueue
. The relevant operation is now added
-to the queue immediately and only becomes ready once the delay/timeout has elapsed.
+- Improve the behavior of
.delay(on:_:)
and .timeout(on:delay:)
when using PromiseContext.operationQueue
. The relevant operation is now added to the queue immediately and only becomes ready once the delay/timeout has elapsed.
- Add
-[TWLPromise initCancelled]
to construct a pre-cancelled promise.
-- Add
Promise.init(on:fulfilled:after:)
, Promise.init(on:rejected:after:)
, and Promise.init(on:result:after:)
. These initializers produce
-something akin to Promise(fulfilled: value).delay(after)
except they respond to cancellation immediately. This makes them more suitable for use as
-cancellable timers, as opposed to .delay(_:)
which is more intended for debugging (#27).
-- Try to clean up the callback list when calling
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
. Any deallocated promises at the head of the
-callback list will be removed. This will help keep the callback list from growing uncontrollably when a token is used merely to cancel all promises when the owner
-deallocates as opposed to being periodically invalidated during its lifetime (#25).
-- Cancel the
.delay(_:)
timer if .requestCancel()
is invoked and the upstream promise cancelled. This way requested cancels will skip the delay, but
-unexpected cancels will still delay the result (#26).
+- Add
Promise.init(on:fulfilled:after:)
, Promise.init(on:rejected:after:)
, and Promise.init(on:result:after:)
. These initializers produce something akin to Promise(fulfilled: value).delay(after)
except they respond to cancellation immediately. This makes them more suitable for use as cancellable timers, as opposed to .delay(_:)
which is more intended for debugging (#27).
+- Try to clean up the callback list when calling
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
. Any deallocated promises at the head of the callback list will be removed. This will help keep the callback list from growing uncontrollably when a token is used merely to cancel all promises when the owner deallocates as opposed to being periodically invalidated during its lifetime (#25).
+- Cancel the
.delay(_:)
timer if .requestCancel()
is invoked and the upstream promise cancelled. This way requested cancels will skip the delay, but unexpected cancels will still delay the result (#26).
v0.3.4
-- Add
PromiseInvalidationToken.cancelWithoutInvalidating()
. This method cancels any associated promises without invalidating the token, thus
-allowing for any onCancel
and always
handlers on the promises to fire (#23).
+- Add
PromiseInvalidationToken.cancelWithoutInvalidating()
. This method cancels any associated promises without invalidating the token, thus allowing for any onCancel
and always
handlers on the promises to fire (#23).
- Add missing
Promise
↔ObjCPromise
bridging methods for the case of Value: AnyObject, Error == Swift.Error
(#24).
v0.3.3
@@ -676,8 +565,7 @@ v0.3
- Add
Promise.requestCancelOnInvalidate(_:)
as a convenience for token.requestCancelOnInvalidate(_:)
.
- Add
Promise.requestCancelOnDeinit(_:)
as a convenience for adding a token property to an object that invalites on deinit.
-- Better support for
OperationQueue
with delay
/timeout
. Instead of using the OperationQueue
’s underlying queue, we instead use a .userInitiated
-queue for the timer and hop onto the OperationQueue
to resolve the promise.
+- Better support for
OperationQueue
with delay
/timeout
. Instead of using the OperationQueue
’s underlying queue, we instead use a .userInitiated
queue for the timer and hop onto the OperationQueue
to resolve the promise.
v0.2
@@ -693,7 +581,7 @@ v0.1
diff --git a/docs/docsets/Tomorrowland.docset/Contents/Resources/Documents/search.json b/docs/docsets/Tomorrowland.docset/Contents/Resources/Documents/search.json
index 10637b2..3a649da 100644
--- a/docs/docsets/Tomorrowland.docset/Contents/Resources/Documents/search.json
+++ b/docs/docsets/Tomorrowland.docset/Contents/Resources/Documents/search.json
@@ -1 +1 @@
-{"Typealiases.html#/s:12Tomorrowland17StdDelayedPromisea":{"name":"StdDelayedPromise","abstract":"StdDelayedPromise
is an alias for a DelayedPromise
whose error type is Swift.Error
.
"},"Typealiases.html#/s:12Tomorrowland10StdPromisea":{"name":"StdPromise","abstract":"StdPromise
is an alias for a Promise
whose error type is Swift.Error
.
"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5innerAA0C0Vyxq_Gvp":{"name":"inner","abstract":"The wrapped Promise
.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5tokenAA0c12InvalidationB0Vvp":{"name":"token","abstract":"The PromiseInvalidationToken
to use when invoking methods on the wrapped Promise
.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7promise5tokenACyxq_GAA0C0Vyxq_G_AA0c12InvalidationB0Vtcfc":{"name":"init(promise:token:)","abstract":"Returns a new TokenPromise
that wraps the given promise.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV4then2on_ACyxq_GAA0C7ContextO_yxctF":{"name":"then(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3map2on_ACyqd__q_GAA0C7ContextO_qd__xctlF":{"name":"map(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7flatMap2on_ACyqd__q_GAA0C7ContextO_AA0C0Vyqd__q_GxctlF":{"name":"flatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5catch2on_ACyxq_GAA0C7ContextO_yq_ctF":{"name":"catch(on:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7recover2on_ACyxAA7NoErrorOGAA0C7ContextO_xq_ctF":{"name":"recover(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV8mapError2on_ACyxqd__GAA0C7ContextO_qd__q_ctlF":{"name":"mapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV12flatMapError2on_ACyxqd__GAA0C7ContextO_AA0C0Vyxqd__Gq_ctlF":{"name":"flatMapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV11tryMapError2on_ACyxs0F0_pGAA0C7ContextO_qd__q_KctsAFRd__lF":{"name":"tryMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV15tryFlatMapError2on_ACyxs0G0_pGAA0C7ContextO_AA0C0Vyxqd__Gq_KctsAFRd__lF":{"name":"tryFlatMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryMapError(on:_:)":{"name":"tryMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMapError(on:_:)":{"name":"tryFlatMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV6always2on_ACyxq_GAA0C7ContextO_yAA0C6ResultOyxq_GctF":{"name":"always(on:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV9mapResult2on0F8CompleteACyqd__qd_0_GAA0C7ContextO_AA0cE0Oyqd__qd_0_GAKyxq_Gctr0_lF":{"name":"mapResult(on:onComplete:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV13flatMapResult2on_ACyqd__qd_0_GAA0C7ContextO_AA0C0Vyqd__qd_0_GAA0cF0Oyxq_Gctr0_lF":{"name":"flatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV12tryMapResult2on_ACyqd__s5Error_pGAA0C7ContextO_AA0cF0Oyqd__qd_0_GAKyxq_GKctsAFRd_0_r0_lF":{"name":"tryMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV16tryFlatMapResult2on_ACyqd__s5Error_pGAA0C7ContextO_AA0C0Vyqd__qd_0_GAA0cG0Oyxq_GKctsAFRd_0_r0_lF":{"name":"tryFlatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryMapResult(on:_:)":{"name":"tryMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMapResult(on:_:)":{"name":"tryFlatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3tap2on_ACyxq_GAA0C7ContextO_yAA0C6ResultOyxq_GctF":{"name":"tap(on:_:)","abstract":"
Registers a callback that will be invoked when the promise is resolved without affecting behavior.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3tapACyxq_GyF":{"name":"tap()","abstract":"Returns a new TokenPromise
that adopts the result of the receiver without affecting its","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV8onCancel0D0_ACyxq_GAA0C7ContextO_yyctF":{"name":"onCancel(on:_:)","abstract":"
Registers a callback that will be invoked when the promise is cancelled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV4forkyACyxq_GyAEKXEKF":{"name":"fork(_:)","abstract":"Passes the TokenPromise
to a block and then returns the TokenPromise
for further","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV14ignoringCancelACyxq_GyF":{"name":"ignoringCancel()","abstract":"
Returns a new TokenPromise
that adopts the value of the receiver but ignores cancel","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"
Two TokenPromise
s compare as equal if they represent the same promise.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE7tryThen2on_ACyxsAD_pGAA0C7ContextO_yxKctF":{"name":"tryThen(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE6tryMap2on_ACyqd__sAD_pGAA0C7ContextO_qd__xKctlF":{"name":"tryMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMap(on:_:)":{"name":"tryFlatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE10tryFlatMap2on_ACyqd__sAD_pGAA0C7ContextO_AA0C0Vyqd__qd_0_GxKctsADRd_0_r0_lF":{"name":"tryFlatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE10tryRecover2on_ACyxsAD_pGAA0C7ContextO_xsAD_pKctF":{"name":"tryRecover(on:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE010tryFlatMapD02on_ACyxsAD_pGAA0C7ContextO_AA0C0Vyxqd__GsAD_pKctsADRd__lF":{"name":"tryFlatMapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV18invalidateOnDeinitACSb_tcfc":{"name":"init(invalidateOnDeinit:)","abstract":"Creates and returns a new PromiseInvalidationToken
.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV10invalidateyyF":{"name":"invalidate()","abstract":"Invalidates the token and cancels any associated promises.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25cancelWithoutInvalidatingyyF":{"name":"cancelWithoutInvalidating()","abstract":"Cancels any associated promises without invalidating the token.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25requestCancelOnInvalidateyyAA0B0Vyxq_Gr0_lF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Registers a Promise
to be requested to cancel automatically when the token is invalidated.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25requestCancelOnInvalidateyySo10TWLPromiseCyxq_GRlzCRl_Cr0_lF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Registers an ObjCPromise
to be requested to cancel automatically when the token is","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV05chainC04from34includingCancelWithoutInvalidatingyAC_SbtF":{"name":"chainInvalidation(from:includingCancelWithoutInvalidating:)","abstract":"
Invalidates the token whenever another token is invalidated.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:s28CustomDebugStringConvertibleP16debugDescriptionSSvp":{"name":"debugDescription","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseInvalidationToken"},"Structs/PromiseCancellable.html#/s:12Tomorrowland18PromiseCancellableV13requestCancelyyF":{"name":"requestCancel()","abstract":"Requests cancellation of the promise this PromiseCancellable
was created from.
","parent_name":"PromiseCancellable"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7fulfill4withyx_tF":{"name":"fulfill(with:)","abstract":"Fulfills the promise with the given value.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV6reject4withyq__tF":{"name":"reject(with:)","abstract":"Rejects the promise with the given error.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV6cancelyyF":{"name":"cancel()","abstract":"Cancels the promise.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7resolve4withyAA0B6ResultOyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7resolve4withyACyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with another promise.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV15onRequestCancel0D0_yAA0B7ContextO_yAEyxq__GctF":{"name":"onRequestCancel(on:_:)","abstract":"Registers a block that will be invoked if requestCancel()
is invoked on the promise","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV18hasRequestedCancelSbvp":{"name":"hasRequestedCancel","abstract":"
Returns whether the promise has already been requested to cancel.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5Error_pRs_rlE7resolve4withyAA0B6ResultOyxqd__G_tsAFRd__lF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5Error_pRs_rlE14handleCallback08isCancelD0yxSg_sAF_pSgtcSbsAF_pc_tF":{"name":"handleCallback(isCancelError:)","abstract":"Convenience method for handling framework callbacks.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5ErrorR_rlE7resolve4withys6ResultOyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html":{"name":"Resolver","abstract":"A Resolver
is used to fulfill, reject, or cancel its associated Promise
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6resultAA0B6ResultOyxq_GSgvp":{"name":"result","abstract":"Returns the result of the promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV16makeWithResolverACyxq_G_AC0E0Vyxq__GtyFZ":{"name":"makeWithResolver()","abstract":"Returns a Promise
and a Promise.Resolver
that can be used to fulfill that promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on_ACyxq_GAA0B7ContextO_yAC8ResolverVyxq__Gctcfc":{"name":"init(on:_:)","abstract":"Returns a new Promise
that will be resolved using the given block.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9fulfilledACyxq_Gx_tcfc":{"name":"init(fulfilled:)","abstract":"Returns a Promise
that is already fulfilled with the given value.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8rejectedACyxq_Gq__tcfc":{"name":"init(rejected:)","abstract":"Returns a Promise
that is already rejected with the given error.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4withACyxq_GAA0B6ResultOyxq_G_tcfc":{"name":"init(with:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4then2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyxctF":{"name":"then(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3map2on5token_ACyqd__q_GAA0B7ContextO_AA0B17InvalidationTokenVSgqd__xctlF":{"name":"map(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7flatMap2on5token_ACyqd__q_GAA0B7ContextO_AA0B17InvalidationTokenVSgAGxctlF":{"name":"flatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV5catch2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyq_ctF":{"name":"catch(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7recover2on5token_ACyxAA7NoErrorOGAA0B7ContextO_AA0B17InvalidationTokenVSgxq_ctF":{"name":"recover(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8mapError2on5token_ACyxqd__GAA0B7ContextO_AA0B17InvalidationTokenVSgqd__q_ctlF":{"name":"mapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV12flatMapError2on5token_ACyxqd__GAA0B7ContextO_AA0B17InvalidationTokenVSgAGq_ctlF":{"name":"flatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV11tryMapError2on5token_ACyxs0E0_pGAA0B7ContextO_AA0B17InvalidationTokenVSgqd__q_KctsAGRd__lF":{"name":"tryMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV15tryFlatMapError2on5token_ACyxs0F0_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyxqd__Gq_KctsAGRd__lF":{"name":"tryFlatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/tryMapError(on:token:_:)":{"name":"tryMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMapError(on:token:_:)":{"name":"tryFlatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6always2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyAA0B6ResultOyxq_GctF":{"name":"always(on:token:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9mapResult2on5token_ACyqd__qd_0_GAA0B7ContextO_AA0B17InvalidationTokenVSgAA0bD0Oyqd__qd_0_GANyxq_Gctr0_lF":{"name":"mapResult(on:token:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV13flatMapResult2on5token_ACyqd__qd_0_GAA0B7ContextO_AA0B17InvalidationTokenVSgAgA0bE0Oyxq_Gctr0_lF":{"name":"flatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV12tryMapResult2on5token_ACyqd__s5Error_pGAA0B7ContextO_AA0B17InvalidationTokenVSgAA0bE0Oyqd__qd_0_GAOyxq_GKctsAGRd_0_r0_lF":{"name":"tryMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV16tryFlatMapResult2on5token_ACyqd__s5Error_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyqd__qd_0_GAA0bF0Oyxq_GKctsAGRd_0_r0_lF":{"name":"tryFlatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/tryMapResult(on:token:_:)":{"name":"tryMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMapResult(on:token:_:)":{"name":"tryFlatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3tap2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyAA0B6ResultOyxq_GctF":{"name":"tap(on:token:_:)","abstract":"
Registers a callback that will be invoked when the promise is resolved without affecting behavior.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3tapACyxq_GyF":{"name":"tap()","abstract":"Returns a new Promise
that adopts the result of the receiver without affecting its behavior.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8onCancel0C05token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyyctF":{"name":"onCancel(on:token:_:)","abstract":"Registers a callback that will be invoked when the promise is cancelled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV23propagatingCancellation2on15cancelRequestedACyxq_GAA0B7ContextO_yAGctF":{"name":"propagatingCancellation(on:cancelRequested:)","abstract":"Returns a promise that adopts the same value as the receiver, and propagates cancellation","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4forkyACyxq_GyAEKXEKF":{"name":"fork(_:)","abstract":"
Passes the Promise
to a block and then returns the Promise
for further chaining.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV13requestCancelyyF":{"name":"requestCancel()","abstract":"Requests that the Promise
should be cancelled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV25requestCancelOnInvalidateyACyxq_GAA0B17InvalidationTokenVF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Requests that the Promise
should be cancelled when the token is invalidated.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV14ignoringCancelACyxq_GyF":{"name":"ignoringCancel()","abstract":"Returns a new Promise
that adopts the value of the receiver but ignores cancel requests.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6resultACyxq_GAA0B6ResultOyxq_G_tcfc":{"name":"init(result:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on6result5afterACyxq_GAA0B7ContextO_AA0B6ResultOyxq_GSdtcfc":{"name":"init(on:result:after:)","abstract":"Returns a Promise
that resolves with the given result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV21requestCancelOnDeinityACyxq_GyXlF":{"name":"requestCancelOnDeinit(_:)","abstract":"Requests that the Promise
should be cancelled when the object deinits.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Two Promise
s compare as equal if they represent the same promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV11cancellableAA0B11CancellableVvp":{"name":"cancellable","abstract":"Returns a value that can be used to cancel this promise without holding onto the full promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9withTokenyAA0dB0Vyxq_GAA0b12InvalidationD0VF":{"name":"withToken(_:)","abstract":"Returns a new TokenPromise
that wraps the receiver.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on9fulfilled5afterACyxq_GAA0B7ContextO_xSdtcfc":{"name":"init(on:fulfilled:after:)","abstract":"Returns a Promise
that fulfills with the given value after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on8rejected5afterACyxq_GAA0B7ContextO_q_Sdtcfc":{"name":"init(on:rejected:after:)","abstract":"Returns a Promise
that rejects with the given error after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on4with5afterACyxq_GAA0B7ContextO_AA0B6ResultOyxq_GSdtcfc":{"name":"init(on:with:after:)","abstract":"Returns a Promise
that resolves with the given result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV5delay2on_ACyxq_GAA0B7ContextO_SdtF":{"name":"delay(on:_:)","abstract":"Returns a new Promise
that adopts the receiver’s result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7timeout2on5delayACyxAA0B12TimeoutErrorOyq_GGAA0B7ContextO_SdtF":{"name":"timeout(on:delay:)","abstract":"Returns a Promise
that is rejected with an error if the receiver does not resolve within","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5ErrorR_rlE6upcastACyxsAD_pGvp":{"name":"upcast","abstract":"
Returns a new promise with an error type of Swift.Error
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVA2A7NoErrorORs_rlE6upcastACyxs0D0_pGvp":{"name":"upcast","abstract":"Returns a new promise with an error type of Swift.Error
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE2on_ACyxsAD_pGAA0B7ContextO_yAC8ResolverVyxsAD_p_GKctcfc":{"name":"init(on:_:)","abstract":"Returns a new Promise
that will be resolved using the given block.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE7tryThen2on5token_ACyxsAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgyxKctF":{"name":"tryThen(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE6tryMap2on5token_ACyqd__sAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgqd__xKctlF":{"name":"tryMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMap(on:token:_:)":{"name":"tryFlatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE10tryFlatMap2on5token_ACyqd__sAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyqd__qd_0_GxKctsADRd_0_r0_lF":{"name":"tryFlatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE10tryRecover2on5token_ACyxsAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgxsAD_pKctF":{"name":"tryRecover(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5ErrorR_rlE4withACyxq_Gs6ResultOyxq_G_tcfc":{"name":"init(with:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE7timeout2on5delayACyxsAD_pGAA0B7ContextO_SdtF":{"name":"timeout(on:delay:)","abstract":"Returns a Promise
that is rejected with an error if the receiver does not resolve within","parent_name":"Promise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV8Resolvera":{"name":"Resolver","abstract":"
The type of the promise resolver. See Promise<Value,Error>.Resolver
.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV2on_ACyxq_GAA0C7ContextO_yAA0C0V8ResolverVyxq__Gctcfc":{"name":"init(on:_:)","abstract":"Returns a new DelayedPromise
that can be resolved with the given block.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV7promiseAA0C0Vyxq_Gvp":{"name":"promise","abstract":"Returns a Promise
that asynchronously contains the value of the computation.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Two DelayedPromise
s compare as equal if they would produce equal Promise
s.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html":{"name":"DelayedPromise","abstract":"DelayedPromise
is like a Promise
but it doesn’t invoke its callback until the .promise
"},"Structs/Promise.html":{"name":"Promise","abstract":"
A Promise
is a construct that will eventually hold a value or error, and can invoke callbacks"},"Structs/PromiseCancellable.html":{"name":"PromiseCancellable","abstract":"
A type that can be used to cancel a promise without holding onto the full promise.
"},"Structs/PromiseInvalidationToken.html":{"name":"PromiseInvalidationToken","abstract":"An invalidation token that can be used to cancel callbacks registered to a Promise
.
"},"Structs/TokenPromise.html":{"name":"TokenPromise","abstract":"A Promise
adapter that automatically applies a PromiseInvalidationToken
.
"},"Functions.html#/s:12Tomorrowland4when9fulfilled3qos15cancelOnFailureAA7PromiseVySayxGq_GSayAGyxq_GG_8Dispatch0I3QoSV0J6SClassOSbtr0_lF":{"name":"when(fulfilled:qos:cancelOnFailure:)","abstract":"Waits on an array of Promise
s and returns a Promise
that is fulfilled with an array of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled_____3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_q2_q3_tq4_GAGyxq4_G_AGyq_q4_GAGyq0_q4_GAGyq1_q4_GAGyq2_q4_GAGyq3_q4_G8Dispatch0I3QoSV0J6SClassOSbtr5_lF":{"name":"when(fulfilled:_:_:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled____3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_q2_tq3_GAGyxq3_G_AGyq_q3_GAGyq0_q3_GAGyq1_q3_GAGyq2_q3_G8Dispatch0I3QoSV0J6SClassOSbtr4_lF":{"name":"when(fulfilled:_:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled___3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_tq2_GAGyxq2_G_AGyq_q2_GAGyq0_q2_GAGyq1_q2_G8Dispatch0I3QoSV0J6SClassOSbtr3_lF":{"name":"when(fulfilled:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled__3qos15cancelOnFailureAA7PromiseVyx_q_q0_tq1_GAGyxq1_G_AGyq_q1_GAGyq0_q1_G8Dispatch0I3QoSV0J6SClassOSbtr2_lF":{"name":"when(fulfilled:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled_3qos15cancelOnFailureAA7PromiseVyx_q_tq0_GAGyxq0_G_AGyq_q0_G8Dispatch0I3QoSV0J6SClassOSbtr1_lF":{"name":"when(fulfilled:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when5first15cancelRemainingAA7PromiseVyxq_GSayAGG_Sbtr0_lF":{"name":"when(first:cancelRemaining:)","abstract":"
Returns a Promise
that is resolved with the result of the first resolved input Promise
.
"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorO8timedOutyACyxGAEmlF":{"name":"timedOut","abstract":"The promise did not resolve within the given interval.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorO8rejectedyACyxGxcAEmlF":{"name":"rejected(_:)","abstract":"The promise was rejected with an error.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:10Foundation13CustomNSErrorP13errorUserInfoSDySSypGvp":{"name":"errorUserInfo","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorOAASQRzlE2eeoiySbACyxG_AEtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorOAASQRzlE2neoiySbACyxG_AEtFZ":{"name":"!=(_:_:)","abstract":"Returns a Boolean value indicating whether two values are not equal.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseTimeoutError"},"Enums/NoError.html#/s:12Tomorrowland7NoErrorO2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"NoError"},"Enums/NoError.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"NoError"},"Enums/NoError.html#/s:Se4fromxs7Decoder_p_tKcfc":{"name":"init(from:)","parent_name":"NoError"},"Enums/NoError.html#/s:SE6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","parent_name":"NoError"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5valueyACyxq_GxcAEmr0_lF":{"name":"value(_:)","abstract":"The value the promise was fulfilled with.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5erroryACyxq_Gq_cAEmr0_lF":{"name":"error(_:)","abstract":"The error the promise was rejected with.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO9cancelledyACyxq_GAEmr0_lF":{"name":"cancelled","abstract":"The promise was cancelled.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5valuexSgvp":{"name":"value","abstract":"Returns the contained value if the result is .value
, otherwise nil
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5errorq_Sgvp":{"name":"error","abstract":"Returns the contained error if the result is .error
, otherwise nil
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO11isCancelledSbvp":{"name":"isCancelled","abstract":"Returns true
if the result is .cancelled
, otherwise false
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO3mapyACyqd__q_Gqd__xKXEKlF":{"name":"map(_:)","abstract":"Maps a successful result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO8mapErroryACyxqd__Gqd__q_KXEKlF":{"name":"mapError(_:)","abstract":"Maps a rejected result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO7flatMapyACyqd__q_GAExKXEKlF":{"name":"flatMap(_:)","abstract":"Maps a successful result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO12flatMapErroryACyxqd__GAEq_KXEKlF":{"name":"flatMapError(_:)","abstract":"Maps a rejected result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAASQRzSQR_rlE2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAASQRzSQR_rlE2neoiySbACyxq_G_AEtFZ":{"name":"!=(_:_:)","abstract":"Returns a Boolean value indicating whether two values are not equal.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:SE6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:Se4fromxs7Decoder_p_tKcfc":{"name":"init(from:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAAs5ErrorR_rlEyACyxq_Gs0C0Oyxq_Gcfc":{"name":"init(_:)","abstract":"Returns a PromiseResult
from a Result
.
","parent_name":"PromiseResult"},"Enums/PromiseCallbackError.html#/c:@M@Tomorrowland@E@TWLPromiseCallbackError@TWLPromiseCallbackErrorAPIMismatch":{"name":"apiMismatch","abstract":"The callback did not conform to the expected API.
","parent_name":"PromiseCallbackError"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO4mainyA2CmF":{"name":"main","abstract":"Execute on the main queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO10backgroundyA2CmF":{"name":"background","abstract":"Execute on a dispatch queue with the .background
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO7utilityyA2CmF":{"name":"utility","abstract":"Execute on a dispatch queue with the .utility
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO7defaultyA2CmF":{"name":"default","abstract":"Execute on a dispatch queue with the .default
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO13userInitiatedyA2CmF":{"name":"userInitiated","abstract":"Execute on a dispatch queue with the .userInitiated
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO15userInteractiveyA2CmF":{"name":"userInteractive","abstract":"Execute on a dispatch queue with the .userInteractive
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO5queueyACSo012OS_dispatch_D0CcACmF":{"name":"queue(_:)","abstract":"Execute on the specified dispatch queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO14operationQueueyACSo011NSOperationE0CcACmF":{"name":"operationQueue(_:)","abstract":"Execute on the specified operation queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO9immediateyA2CmF":{"name":"immediate","abstract":"Execute synchronously.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO5nowOryA2CcACmF":{"name":"nowOr(_:)","abstract":"Execute synchronously if the promise is already resolved, otherwise use another context.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO4autoACvpZ":{"name":"auto","abstract":"Returns .main
when accessed from the main thread, otherwise .default
.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO14isExecutingNowSbvpZ":{"name":"isExecutingNow","abstract":"Returns whether a .nowOr(_:)
context is executing synchronously.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO3qosAC8Dispatch0E3QoSV0F6SClassO_tcfc":{"name":"init(qos:)","abstract":"Returns the PromiseContext
that corresponds to a given Dispatch QoS class.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html":{"name":"PromiseContext","abstract":"The context in which a Promise body or callback is evaluated.
"},"Enums/PromiseCallbackError.html":{"name":"PromiseCallbackError","abstract":"An error potentially returned from Promise.Resolver.handleCallback(isCancelError:)
.
"},"Enums/PromiseResult.html":{"name":"PromiseResult","abstract":"The result of a resolved promise.
"},"Enums/NoError.html":{"name":"NoError","abstract":"NoError
is a type that cannot be constructed.
"},"Enums/PromiseTimeoutError.html":{"name":"PromiseTimeoutError","abstract":"The error type returned from Promise.timeout
.
"},"Enums.html":{"name":"Enumerations","abstract":"The following enumerations are available globally.
"},"Functions.html":{"name":"Functions","abstract":"The following functions are available globally.
"},"Structs.html":{"name":"Structures","abstract":"The following structures are available globally.
"},"Typealiases.html":{"name":"Type Aliases","abstract":"The following type aliases are available globally.
"}}
\ No newline at end of file
+{"Typealiases.html#/s:12Tomorrowland17StdDelayedPromisea":{"name":"StdDelayedPromise","abstract":"StdDelayedPromise
is an alias for a DelayedPromise
whose error type is Swift.Error
.
"},"Typealiases.html#/s:12Tomorrowland10StdPromisea":{"name":"StdPromise","abstract":"StdPromise
is an alias for a Promise
whose error type is Swift.Error
.
"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5innerAA0C0Vyxq_Gvp":{"name":"inner","abstract":"The wrapped Promise
.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5tokenAA0c12InvalidationB0Vvp":{"name":"token","abstract":"The PromiseInvalidationToken
to use when invoking methods on the wrapped Promise
.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7promise5tokenACyxq_GAA0C0Vyxq_G_AA0c12InvalidationB0Vtcfc":{"name":"init(promise:token:)","abstract":"Returns a new TokenPromise
that wraps the given promise.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV4then2on_ACyxq_GAA0C7ContextO_yxctF":{"name":"then(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3map2on_ACyqd__q_GAA0C7ContextO_qd__xctlF":{"name":"map(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7flatMap2on_ACyqd__q_GAA0C7ContextO_AA0C0Vyqd__q_GxctlF":{"name":"flatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5catch2on_ACyxq_GAA0C7ContextO_yq_ctF":{"name":"catch(on:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7recover2on_ACyxAA7NoErrorOGAA0C7ContextO_xq_ctF":{"name":"recover(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV8mapError2on_ACyxqd__GAA0C7ContextO_qd__q_ctlF":{"name":"mapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV12flatMapError2on_ACyxqd__GAA0C7ContextO_AA0C0Vyxqd__Gq_ctlF":{"name":"flatMapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV11tryMapError2on_ACyxs0F0_pGAA0C7ContextO_qd__q_KctsAFRd__lF":{"name":"tryMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV15tryFlatMapError2on_ACyxs0G0_pGAA0C7ContextO_AA0C0Vyxqd__Gq_KctsAFRd__lF":{"name":"tryFlatMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryMapError(on:_:)":{"name":"tryMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMapError(on:_:)":{"name":"tryFlatMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV6always2on_ACyxq_GAA0C7ContextO_yAA0C6ResultOyxq_GctF":{"name":"always(on:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV9mapResult2on0F8CompleteACyqd__qd_0_GAA0C7ContextO_AA0cE0Oyqd__qd_0_GAKyxq_Gctr0_lF":{"name":"mapResult(on:onComplete:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV13flatMapResult2on_ACyqd__qd_0_GAA0C7ContextO_AA0C0Vyqd__qd_0_GAA0cF0Oyxq_Gctr0_lF":{"name":"flatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV12tryMapResult2on_ACyqd__s5Error_pGAA0C7ContextO_AA0cF0Oyqd__qd_0_GAKyxq_GKctsAFRd_0_r0_lF":{"name":"tryMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV16tryFlatMapResult2on_ACyqd__s5Error_pGAA0C7ContextO_AA0C0Vyqd__qd_0_GAA0cG0Oyxq_GKctsAFRd_0_r0_lF":{"name":"tryFlatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryMapResult(on:_:)":{"name":"tryMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMapResult(on:_:)":{"name":"tryFlatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3tap2on_ACyxq_GAA0C7ContextO_yAA0C6ResultOyxq_GctF":{"name":"tap(on:_:)","abstract":"
Registers a callback that will be invoked when the promise is resolved without affecting behavior.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3tapACyxq_GyF":{"name":"tap()","abstract":"Returns a new TokenPromise
that adopts the result of the receiver without affecting its","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV8onCancel0D0_ACyxq_GAA0C7ContextO_yyctF":{"name":"onCancel(on:_:)","abstract":"
Registers a callback that will be invoked when the promise is cancelled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV4forkyACyxq_GyAEKXEKF":{"name":"fork(_:)","abstract":"Passes the TokenPromise
to a block and then returns the TokenPromise
for further","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV14ignoringCancelACyxq_GyF":{"name":"ignoringCancel()","abstract":"
Returns a new TokenPromise
that adopts the value of the receiver but ignores cancel","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"
Two TokenPromise
s compare as equal if they represent the same promise.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE7tryThen2on_ACyxsAD_pGAA0C7ContextO_yxKctF":{"name":"tryThen(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE6tryMap2on_ACyqd__sAD_pGAA0C7ContextO_qd__xKctlF":{"name":"tryMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMap(on:_:)":{"name":"tryFlatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE10tryFlatMap2on_ACyqd__sAD_pGAA0C7ContextO_AA0C0Vyqd__qd_0_GxKctsADRd_0_r0_lF":{"name":"tryFlatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE10tryRecover2on_ACyxsAD_pGAA0C7ContextO_xsAD_pKctF":{"name":"tryRecover(on:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE010tryFlatMapD02on_ACyxsAD_pGAA0C7ContextO_AA0C0Vyxqd__GsAD_pKctsADRd__lF":{"name":"tryFlatMapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV18invalidateOnDeinitACSb_tcfc":{"name":"init(invalidateOnDeinit:)","abstract":"Creates and returns a new PromiseInvalidationToken
.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV10invalidateyyF":{"name":"invalidate()","abstract":"Invalidates the token and cancels any associated promises.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25cancelWithoutInvalidatingyyF":{"name":"cancelWithoutInvalidating()","abstract":"Cancels any associated promises without invalidating the token.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25requestCancelOnInvalidateyyAA0B0Vyxq_Gr0_lF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Registers a Promise
to be requested to cancel automatically when the token is invalidated.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25requestCancelOnInvalidateyySo10TWLPromiseCyxq_GRlzCRl_Cr0_lF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Registers an ObjCPromise
to be requested to cancel automatically when the token is","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV05chainC04from34includingCancelWithoutInvalidatingyAC_SbtF":{"name":"chainInvalidation(from:includingCancelWithoutInvalidating:)","abstract":"
Invalidates the token whenever another token is invalidated.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:s28CustomDebugStringConvertibleP16debugDescriptionSSvp":{"name":"debugDescription","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseInvalidationToken"},"Structs/PromiseCancellable.html#/s:12Tomorrowland18PromiseCancellableV13requestCancelyyF":{"name":"requestCancel()","abstract":"Requests cancellation of the promise this PromiseCancellable
was created from.
","parent_name":"PromiseCancellable"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7fulfill4withyx_tF":{"name":"fulfill(with:)","abstract":"Fulfills the promise with the given value.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV6reject4withyq__tF":{"name":"reject(with:)","abstract":"Rejects the promise with the given error.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV6cancelyyF":{"name":"cancel()","abstract":"Cancels the promise.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7resolve4withyAA0B6ResultOyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7resolve4withyACyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with another promise.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV15onRequestCancel0D0_yAA0B7ContextO_yAEyxq__GctF":{"name":"onRequestCancel(on:_:)","abstract":"Registers a block that will be invoked if requestCancel()
is invoked on the promise","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV18hasRequestedCancelSbvp":{"name":"hasRequestedCancel","abstract":"
Returns whether the promise has already been requested to cancel.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5Error_pRs_rlE7resolve4withyAA0B6ResultOyxqd__G_tsAFRd__lF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5Error_pRs_rlE14handleCallback08isCancelD0yxSg_sAF_pSgtcSbsAF_pc_tF":{"name":"handleCallback(isCancelError:)","abstract":"Convenience method for handling framework callbacks.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5ErrorR_rlE7resolve4withys6ResultOyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html":{"name":"Resolver","abstract":"A Resolver
is used to fulfill, reject, or cancel its associated Promise
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6resultAA0B6ResultOyxq_GSgvp":{"name":"result","abstract":"Returns the result of the promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV16makeWithResolverACyxq_G_AC0E0Vyxq__GtyFZ":{"name":"makeWithResolver()","abstract":"Returns a Promise
and a Promise.Resolver
that can be used to fulfill that promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on_ACyxq_GAA0B7ContextO_yAC8ResolverVyxq__Gctcfc":{"name":"init(on:_:)","abstract":"Returns a new Promise
that will be resolved using the given block.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9fulfilledACyxq_Gx_tcfc":{"name":"init(fulfilled:)","abstract":"Returns a Promise
that is already fulfilled with the given value.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8rejectedACyxq_Gq__tcfc":{"name":"init(rejected:)","abstract":"Returns a Promise
that is already rejected with the given error.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4withACyxq_GAA0B6ResultOyxq_G_tcfc":{"name":"init(with:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4then2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyxctF":{"name":"then(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3map2on5token_ACyqd__q_GAA0B7ContextO_AA0B17InvalidationTokenVSgqd__xctlF":{"name":"map(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7flatMap2on5token_ACyqd__q_GAA0B7ContextO_AA0B17InvalidationTokenVSgAGxctlF":{"name":"flatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV5catch2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyq_ctF":{"name":"catch(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7recover2on5token_ACyxAA7NoErrorOGAA0B7ContextO_AA0B17InvalidationTokenVSgxq_ctF":{"name":"recover(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8mapError2on5token_ACyxqd__GAA0B7ContextO_AA0B17InvalidationTokenVSgqd__q_ctlF":{"name":"mapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV12flatMapError2on5token_ACyxqd__GAA0B7ContextO_AA0B17InvalidationTokenVSgAGq_ctlF":{"name":"flatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV11tryMapError2on5token_ACyxs0E0_pGAA0B7ContextO_AA0B17InvalidationTokenVSgqd__q_KctsAGRd__lF":{"name":"tryMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV15tryFlatMapError2on5token_ACyxs0F0_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyxqd__Gq_KctsAGRd__lF":{"name":"tryFlatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/tryMapError(on:token:_:)":{"name":"tryMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMapError(on:token:_:)":{"name":"tryFlatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6always2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyAA0B6ResultOyxq_GctF":{"name":"always(on:token:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9mapResult2on5token_ACyqd__qd_0_GAA0B7ContextO_AA0B17InvalidationTokenVSgAA0bD0Oyqd__qd_0_GANyxq_Gctr0_lF":{"name":"mapResult(on:token:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV13flatMapResult2on5token_ACyqd__qd_0_GAA0B7ContextO_AA0B17InvalidationTokenVSgAgA0bE0Oyxq_Gctr0_lF":{"name":"flatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV12tryMapResult2on5token_ACyqd__s5Error_pGAA0B7ContextO_AA0B17InvalidationTokenVSgAA0bE0Oyqd__qd_0_GAOyxq_GKctsAGRd_0_r0_lF":{"name":"tryMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV16tryFlatMapResult2on5token_ACyqd__s5Error_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyqd__qd_0_GAA0bF0Oyxq_GKctsAGRd_0_r0_lF":{"name":"tryFlatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/tryMapResult(on:token:_:)":{"name":"tryMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMapResult(on:token:_:)":{"name":"tryFlatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3tap2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyAA0B6ResultOyxq_GctF":{"name":"tap(on:token:_:)","abstract":"
Registers a callback that will be invoked when the promise is resolved without affecting behavior.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3tapACyxq_GyF":{"name":"tap()","abstract":"Returns a new Promise
that adopts the result of the receiver without affecting its behavior.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8onCancel0C05token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyyctF":{"name":"onCancel(on:token:_:)","abstract":"Registers a callback that will be invoked when the promise is cancelled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV23propagatingCancellation2on15cancelRequestedACyxq_GAA0B7ContextO_yAGctF":{"name":"propagatingCancellation(on:cancelRequested:)","abstract":"Returns a promise that adopts the same value as the receiver, and propagates cancellation","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9makeChildACyxq_GyF":{"name":"makeChild()","abstract":"
Returns a promise that adopts the same value as the receiver.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4forkyACyxq_GyAEKXEKF":{"name":"fork(_:)","abstract":"Passes the Promise
to a block and then returns the Promise
for further chaining.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV13requestCancelyyF":{"name":"requestCancel()","abstract":"Requests that the Promise
should be cancelled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV25requestCancelOnInvalidateyACyxq_GAA0B17InvalidationTokenVF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Requests that the Promise
should be cancelled when the token is invalidated.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV14ignoringCancelACyxq_GyF":{"name":"ignoringCancel()","abstract":"Returns a new Promise
that adopts the value of the receiver but ignores cancel requests.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6resultACyxq_GAA0B6ResultOyxq_G_tcfc":{"name":"init(result:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on6result5afterACyxq_GAA0B7ContextO_AA0B6ResultOyxq_GSdtcfc":{"name":"init(on:result:after:)","abstract":"Returns a Promise
that resolves with the given result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV21requestCancelOnDeinityACyxq_GyXlF":{"name":"requestCancelOnDeinit(_:)","abstract":"Requests that the Promise
should be cancelled when the object deinits.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Two Promise
s compare as equal if they represent the same promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV11cancellableAA0B11CancellableVvp":{"name":"cancellable","abstract":"Returns a value that can be used to cancel this promise without holding onto the full promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9withTokenyAA0dB0Vyxq_GAA0b12InvalidationD0VF":{"name":"withToken(_:)","abstract":"Returns a new TokenPromise
that wraps the receiver.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on9fulfilled5afterACyxq_GAA0B7ContextO_xSdtcfc":{"name":"init(on:fulfilled:after:)","abstract":"Returns a Promise
that fulfills with the given value after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on8rejected5afterACyxq_GAA0B7ContextO_q_Sdtcfc":{"name":"init(on:rejected:after:)","abstract":"Returns a Promise
that rejects with the given error after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on4with5afterACyxq_GAA0B7ContextO_AA0B6ResultOyxq_GSdtcfc":{"name":"init(on:with:after:)","abstract":"Returns a Promise
that resolves with the given result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV5delay2on_ACyxq_GAA0B7ContextO_SdtF":{"name":"delay(on:_:)","abstract":"Returns a new Promise
that adopts the receiver’s result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7timeout2on5delayACyxAA0B12TimeoutErrorOyq_GGAA0B7ContextO_SdtF":{"name":"timeout(on:delay:)","abstract":"Returns a Promise
that is rejected with an error if the receiver does not resolve within","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5ErrorR_rlE6upcastACyxsAD_pGvp":{"name":"upcast","abstract":"
Returns a new promise with an error type of Swift.Error
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVA2A7NoErrorORs_rlE6upcastACyxs0D0_pGvp":{"name":"upcast","abstract":"Returns a new promise with an error type of Swift.Error
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE2on_ACyxsAD_pGAA0B7ContextO_yAC8ResolverVyxsAD_p_GKctcfc":{"name":"init(on:_:)","abstract":"Returns a new Promise
that will be resolved using the given block.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE7tryThen2on5token_ACyxsAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgyxKctF":{"name":"tryThen(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE6tryMap2on5token_ACyqd__sAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgqd__xKctlF":{"name":"tryMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMap(on:token:_:)":{"name":"tryFlatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE10tryFlatMap2on5token_ACyqd__sAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyqd__qd_0_GxKctsADRd_0_r0_lF":{"name":"tryFlatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE10tryRecover2on5token_ACyxsAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgxsAD_pKctF":{"name":"tryRecover(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5ErrorR_rlE4withACyxq_Gs6ResultOyxq_G_tcfc":{"name":"init(with:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE7timeout2on5delayACyxsAD_pGAA0B7ContextO_SdtF":{"name":"timeout(on:delay:)","abstract":"Returns a Promise
that is rejected with an error if the receiver does not resolve within","parent_name":"Promise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV8Resolvera":{"name":"Resolver","abstract":"
The type of the promise resolver. See Promise<Value,Error>.Resolver
.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV2on_ACyxq_GAA0C7ContextO_yAA0C0V8ResolverVyxq__Gctcfc":{"name":"init(on:_:)","abstract":"Returns a new DelayedPromise
that can be resolved with the given block.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV7promiseAA0C0Vyxq_Gvp":{"name":"promise","abstract":"Returns a Promise
that asynchronously contains the value of the computation.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Two DelayedPromise
s compare as equal if they would produce equal Promise
s.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html":{"name":"DelayedPromise","abstract":"DelayedPromise
is like a Promise
but it doesn’t invoke its callback until the .promise
"},"Structs/Promise.html":{"name":"Promise","abstract":"
A Promise
is a construct that will eventually hold a value or error, and can invoke callbacks"},"Structs/PromiseCancellable.html":{"name":"PromiseCancellable","abstract":"
A type that can be used to cancel a promise without holding onto the full promise.
"},"Structs/PromiseInvalidationToken.html":{"name":"PromiseInvalidationToken","abstract":"An invalidation token that can be used to cancel callbacks registered to a Promise
.
"},"Structs/TokenPromise.html":{"name":"TokenPromise","abstract":"A Promise
adapter that automatically applies a PromiseInvalidationToken
.
"},"Functions.html#/s:12Tomorrowland4when9fulfilled3qos15cancelOnFailureAA7PromiseVySayxGq_GSayAGyxq_GG_8Dispatch0I3QoSV0J6SClassOSbtr0_lF":{"name":"when(fulfilled:qos:cancelOnFailure:)","abstract":"Waits on an array of Promise
s and returns a Promise
that is fulfilled with an array of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled_____3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_q2_q3_tq4_GAGyxq4_G_AGyq_q4_GAGyq0_q4_GAGyq1_q4_GAGyq2_q4_GAGyq3_q4_G8Dispatch0I3QoSV0J6SClassOSbtr5_lF":{"name":"when(fulfilled:_:_:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled____3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_q2_tq3_GAGyxq3_G_AGyq_q3_GAGyq0_q3_GAGyq1_q3_GAGyq2_q3_G8Dispatch0I3QoSV0J6SClassOSbtr4_lF":{"name":"when(fulfilled:_:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled___3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_tq2_GAGyxq2_G_AGyq_q2_GAGyq0_q2_GAGyq1_q2_G8Dispatch0I3QoSV0J6SClassOSbtr3_lF":{"name":"when(fulfilled:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled__3qos15cancelOnFailureAA7PromiseVyx_q_q0_tq1_GAGyxq1_G_AGyq_q1_GAGyq0_q1_G8Dispatch0I3QoSV0J6SClassOSbtr2_lF":{"name":"when(fulfilled:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled_3qos15cancelOnFailureAA7PromiseVyx_q_tq0_GAGyxq0_G_AGyq_q0_G8Dispatch0I3QoSV0J6SClassOSbtr1_lF":{"name":"when(fulfilled:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when5first15cancelRemainingAA7PromiseVyxq_GSayAGG_Sbtr0_lF":{"name":"when(first:cancelRemaining:)","abstract":"
Returns a Promise
that is resolved with the result of the first resolved input Promise
.
"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorO8timedOutyACyxGAEmlF":{"name":"timedOut","abstract":"The promise did not resolve within the given interval.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorO8rejectedyACyxGxcAEmlF":{"name":"rejected(_:)","abstract":"The promise was rejected with an error.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:10Foundation13CustomNSErrorP13errorUserInfoSDySSypGvp":{"name":"errorUserInfo","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorOAASQRzlE2eeoiySbACyxG_AEtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorOAASQRzlE2neoiySbACyxG_AEtFZ":{"name":"!=(_:_:)","abstract":"Returns a Boolean value indicating whether two values are not equal.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseTimeoutError"},"Enums/NoError.html#/s:12Tomorrowland7NoErrorO2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"NoError"},"Enums/NoError.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"NoError"},"Enums/NoError.html#/s:Se4fromxs7Decoder_p_tKcfc":{"name":"init(from:)","parent_name":"NoError"},"Enums/NoError.html#/s:SE6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","parent_name":"NoError"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5valueyACyxq_GxcAEmr0_lF":{"name":"value(_:)","abstract":"The value the promise was fulfilled with.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5erroryACyxq_Gq_cAEmr0_lF":{"name":"error(_:)","abstract":"The error the promise was rejected with.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO9cancelledyACyxq_GAEmr0_lF":{"name":"cancelled","abstract":"The promise was cancelled.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5valuexSgvp":{"name":"value","abstract":"Returns the contained value if the result is .value
, otherwise nil
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5errorq_Sgvp":{"name":"error","abstract":"Returns the contained error if the result is .error
, otherwise nil
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO11isCancelledSbvp":{"name":"isCancelled","abstract":"Returns true
if the result is .cancelled
, otherwise false
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO3mapyACyqd__q_Gqd__xKXEKlF":{"name":"map(_:)","abstract":"Maps a successful result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO8mapErroryACyxqd__Gqd__q_KXEKlF":{"name":"mapError(_:)","abstract":"Maps a rejected result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO7flatMapyACyqd__q_GAExKXEKlF":{"name":"flatMap(_:)","abstract":"Maps a successful result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO12flatMapErroryACyxqd__GAEq_KXEKlF":{"name":"flatMapError(_:)","abstract":"Maps a rejected result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAASQRzSQR_rlE2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAASQRzSQR_rlE2neoiySbACyxq_G_AEtFZ":{"name":"!=(_:_:)","abstract":"Returns a Boolean value indicating whether two values are not equal.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:SE6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:Se4fromxs7Decoder_p_tKcfc":{"name":"init(from:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAAs5ErrorR_rlEyACyxq_Gs0C0Oyxq_Gcfc":{"name":"init(_:)","abstract":"Returns a PromiseResult
from a Result
.
","parent_name":"PromiseResult"},"Enums/PromiseCallbackError.html#/c:@M@Tomorrowland@E@TWLPromiseCallbackError@TWLPromiseCallbackErrorAPIMismatch":{"name":"apiMismatch","abstract":"The callback did not conform to the expected API.
","parent_name":"PromiseCallbackError"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO4mainyA2CmF":{"name":"main","abstract":"Execute on the main queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO10backgroundyA2CmF":{"name":"background","abstract":"Execute on a dispatch queue with the .background
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO7utilityyA2CmF":{"name":"utility","abstract":"Execute on a dispatch queue with the .utility
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO7defaultyA2CmF":{"name":"default","abstract":"Execute on a dispatch queue with the .default
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO13userInitiatedyA2CmF":{"name":"userInitiated","abstract":"Execute on a dispatch queue with the .userInitiated
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO15userInteractiveyA2CmF":{"name":"userInteractive","abstract":"Execute on a dispatch queue with the .userInteractive
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO5queueyACSo012OS_dispatch_D0CcACmF":{"name":"queue(_:)","abstract":"Execute on the specified dispatch queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO14operationQueueyACSo011NSOperationE0CcACmF":{"name":"operationQueue(_:)","abstract":"Execute on the specified operation queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO9immediateyA2CmF":{"name":"immediate","abstract":"Execute synchronously.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO5nowOryA2CcACmF":{"name":"nowOr(_:)","abstract":"Execute synchronously if the promise is already resolved, otherwise use another context.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO4autoACvpZ":{"name":"auto","abstract":"Returns .main
when accessed from the main thread, otherwise .default
.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO14isExecutingNowSbvpZ":{"name":"isExecutingNow","abstract":"Returns whether a .nowOr(_:)
context is executing synchronously.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO3qosAC8Dispatch0E3QoSV0F6SClassO_tcfc":{"name":"init(qos:)","abstract":"Returns the PromiseContext
that corresponds to a given Dispatch QoS class.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html":{"name":"PromiseContext","abstract":"The context in which a Promise body or callback is evaluated.
"},"Enums/PromiseCallbackError.html":{"name":"PromiseCallbackError","abstract":"An error potentially returned from Promise.Resolver.handleCallback(isCancelError:)
.
"},"Enums/PromiseResult.html":{"name":"PromiseResult","abstract":"The result of a resolved promise.
"},"Enums/NoError.html":{"name":"NoError","abstract":"NoError
is a type that cannot be constructed.
"},"Enums/PromiseTimeoutError.html":{"name":"PromiseTimeoutError","abstract":"The error type returned from Promise.timeout
.
"},"Enums.html":{"name":"Enumerations","abstract":"The following enumerations are available globally.
"},"Functions.html":{"name":"Functions","abstract":"The following functions are available globally.
"},"Structs.html":{"name":"Structures","abstract":"The following structures are available globally.
"},"Typealiases.html":{"name":"Type Aliases","abstract":"The following type aliases are available globally.
"}}
\ No newline at end of file
diff --git a/docs/docsets/Tomorrowland.docset/Contents/Resources/docSet.dsidx b/docs/docsets/Tomorrowland.docset/Contents/Resources/docSet.dsidx
index 9cfae1a..1f85035 100644
Binary files a/docs/docsets/Tomorrowland.docset/Contents/Resources/docSet.dsidx and b/docs/docsets/Tomorrowland.docset/Contents/Resources/docSet.dsidx differ
diff --git a/docs/docsets/Tomorrowland.tgz b/docs/docsets/Tomorrowland.tgz
index 2f88f80..1a62290 100644
Binary files a/docs/docsets/Tomorrowland.tgz and b/docs/docsets/Tomorrowland.tgz differ
diff --git a/docs/index.html b/docs/index.html
index 4ab3dfa..c964cb1 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -13,7 +13,7 @@
- Tomorrowland 1.3.0 Docs (100% documented)
+ Tomorrowland 1.4.0 Docs (100% documented)
@@ -115,15 +115,14 @@
Tomorrowland
-
-Tomorrowland is an implementation of Promises for Swift and Objective-C. A Promise is a wrapper around an
-asynchronous task that provides a standard way of subscribing to task resolution as well as chaining promises together.
+Tomorrowland is an implementation of Promises for Swift and Objective-C. A Promise is a wrapper around an asynchronous task that provides a standard way of subscribing to task resolution as well as chaining promises together.
UIApplication.shared.isNetworkActivityIndicatorVisible = true
MyAPI.requestFeed(for: user).then { (feedItems) in
self.refreshUI(with: feedItems)
@@ -138,18 +137,11 @@ Tomorrowland
- It uses atomics internally instead of creating a separate
DispatchQueue
for each promise. This means it’s faster and uses fewer resources.
-- It provides full support for cancellable promises. PromiseKit supports detection of “cancelled” errors but has no way to request cancellation of a promise. Hydra
-supports cancelling a promise, but it can’t actually stop any work being done by the promise unless the promise body itself polls for the cancellation status (so e.g.
-a promise wrapping a network task can’t reasonably cancel the network task). Tomorrowland improves on this by allowing the promise body to observe the
-cancelled state, and allows linking cancellation of a child promise to its parent.
+- It provides full support for cancellable promises. PromiseKit supports detection of “cancelled” errors but has no way to request cancellation of a promise. Hydra supports cancelling a promise, but it can’t actually stop any work being done by the promise unless the promise body itself polls for the cancellation status (so e.g. a promise wrapping a network task can’t reasonably cancel the network task). Tomorrowland improves on this by allowing the promise body to observe the cancelled state, and allows linking cancellation of a child promise to its parent.
- Its Obj-C support makes use of generics for improved type safety and better documentation.
-- Like Hydra but unlike PromiseKit, it provides a way to suppress a registered callback (e.g. because you don’t care about the result anymore and don’t want stale
-data affecting your UI). This is distinct from promise cancellation.
-- Tomorrowland promises are fully generic over the error type, whereas both PromiseKit and Hydra only support using
Error
as the error type. This may result in
-more typing to construct a promise but it allows for much more powerful error handling. Tomorrowland also has some affordances for working with promises that
-use Error
as the error type.
-- Tomorrowland is fully thread-safe. I have no reason to believe PromiseKit isn’t, but (at the time of this writing) there are parts of Hydra that are incorrectly
-implemented in a non-thread-safe manner.
+- Like Hydra but unlike PromiseKit, it provides a way to suppress a registered callback (e.g. because you don’t care about the result anymore and don’t want stale data affecting your UI). This is distinct from promise cancellation.
+- Tomorrowland promises are fully generic over the error type, whereas both PromiseKit and Hydra only support using
Error
as the error type. This may result in more typing to construct a promise but it allows for much more powerful error handling. Tomorrowland also has some affordances for working with promises that use Error
as the error type.
+- Tomorrowland is fully thread-safe. I have no reason to believe PromiseKit isn’t, but (at the time of this writing) there are parts of Hydra that are incorrectly implemented in a non-thread-safe manner.
Installation
Manually
@@ -159,18 +151,15 @@ Carthage
github "lilyball/Tomorrowland" ~> 1.0
-The project file is configured to use Swift 5. The code can be compiled against Swift 4.2 instead, but I’m not aware of any way to instruct Carthage to override the
-swift version during compilation.
+The project file is configured to use Swift 5. The code can be compiled against Swift 4.2 instead, but I’m not aware of any way to instruct Carthage to override the swift version during compilation.
CocoaPods
pod 'Tomorrowland', '~> 1.0'
-The podspec declares support for both Swift 4.2 and Swift 5.0, but selecting the Swift version requires using CoocaPods 1.7.0 or later. When using CocoaPods 1.6
-or earlier the Swift version will default to 5.0.
+The podspec declares support for both Swift 4.2 and Swift 5.0, but selecting the Swift version requires using CoocaPods 1.7.0 or later. When using CocoaPods 1.6 or earlier the Swift version will default to 5.0.
SwiftPM
-Tomorrowland currently relies on a private Obj-C module for its atomics. This arrangement means it is not compatible with Swift Package Manager (as adding
-compatibility would necessitate publicly exposing the private Obj-C module).
+Tomorrowland currently relies on a private Obj-C module for its atomics. This arrangement means it is not compatible with Swift Package Manager (as adding compatibility would necessitate publicly exposing the private Obj-C module).
Usage
Creating Promises
@@ -181,18 +170,11 @@ Creating Promises
})
-The body of this promise runs on the specified PromiseContext
, which in this case is .utility
(which means DispatchQueue.global(qos: .utility)
).
-Unlike callbacks, all created promises must specify a context, so as to avoid accidentally running expensive computations on the main thread. The available contexts
-include .main
, every Dispatch QoS, a specific DispatchQueue
, a specific OperationQueue
, or the value .immediate
which means to run the block
-synchronously. There’s also the special context .auto
, which evaluates to .main
on the main thread and .default
otherwise.
+The body of this promise runs on the specified PromiseContext
, which in this case is .utility
(which means DispatchQueue.global(qos: .utility)
). Unlike callbacks, all created promises must specify a context, so as to avoid accidentally running expensive computations on the main thread. The available contexts include .main
, every Dispatch QoS, a specific DispatchQueue
, a specific OperationQueue
, or the value .immediate
which means to run the block synchronously. There’s also the special context .auto
, which evaluates to .main
on the main thread and .default
otherwise.
-Note: The .immediate
context can be dangerous to use for callback handlers and should be avoided in most cases. It’s primarily intended for creating
-promises, and whenever it’s used with a callback handler the handler must be prepared to execute on any thread. For callbacks it’s usually only useful for short
-thread-agnostic callbacks, such as an .onRequestCancel
that does nothing more than cancelling a URLSessionTask
.
+Note: The .immediate
context can be dangerous to use for callback handlers and should be avoided in most cases. It’s primarily intended for creating promises, and whenever it’s used with a callback handler the handler must be prepared to execute on any thread. For callbacks it’s usually only useful for short thread-agnostic callbacks, such as an .onRequestCancel
that does nothing more than cancelling a URLSessionTask
.
-The body of a Promise
receives a “resolver”, which it must use to fulfill, reject, or cancel the promise. If the resolver goes out of scope without being used, the
-promise is automatically cancelled. If the promise’s error type is Error
, the promise body may also throw an error (as seen above), which is then used to reject the
-promise. This resolver can also be used to observe cancellation requests using resolver.onRequestCancel
, as seen here:
+The body of a Promise
receives a “resolver”, which it must use to fulfill, reject, or cancel the promise. If the resolver goes out of scope without being used, the promise is automatically cancelled. If the promise’s error type is Error
, the promise body may also throw an error (as seen above), which is then used to reject the promise. This resolver can also be used to observe cancellation requests using resolver.onRequestCancel
, as seen here:
let promise = Promise<Data,Error>(on: .immediate, { (resolver) in
let task = urlSession.dataTask(with: url, completionHandler: { (data, response, error) in
if let data = data {
@@ -210,24 +192,16 @@ Creating Promises
})
-Resolvers also have a convenience method handleCallback()
that is intended to make it easy to wrap framework callbacks in promises. This method returns a
-closure that can be used as a callback directly. It also takes an optional isCancelError
parameter that can be used to indicate when an error represents
-cancellation. For example:
+Resolvers also have a convenience method handleCallback()
that is intended to make it easy to wrap framework callbacks in promises. This method returns a closure that can be used as a callback directly. It also takes an optional isCancelError
parameter that can be used to indicate when an error represents cancellation. For example:
geocoder.reverseGeocodeLocation(location, completionHandler: resolver.handleCallback(isCancelError: { CLError.geocodeCanceled ~= $0 }))
Using Promises
-Once you have a promise, you can register callbacks to be executed when the promise is resolved. Most callback methods require a context, but for some of them
-(then
, catch
, always
, and tryThen
) you can omit the context and it will default to .auto
, which means the main thread if the callback is registered from the
-main thread, otherwise the dispatch queue with QoS .default
.
+Once you have a promise, you can register callbacks to be executed when the promise is resolved. Most callback methods require a context, but for some of them (then
, catch
, always
, and tryThen
) you can omit the context and it will default to .auto
, which means the main thread if the callback is registered from the main thread, otherwise the dispatch queue with QoS .default
.
-When you register a callback, the method also returns a Promise
. All callback registration methods return a new Promise
even if the callback doesn’t affect the
-value of the promise. The reason for this is so chained callbacks always guarantee that the previous callback finished executing before the new one starts, even
-when using concurrent contexts (e.g. .utility
), and so cancelling the returned promise doesn’t cancel the original one if any other callbacks were registered on
-it.
+When you register a callback, the method also returns a Promise
. All callback registration methods return a new Promise
even if the callback doesn’t affect the value of the promise. The reason for this is so chained callbacks always guarantee that the previous callback finished executing before the new one starts, even when using concurrent contexts (e.g. .utility
), and so cancelling the returned promise doesn’t cancel the original one if any other callbacks were registered on it.
-Most callback registration methods also have versions that allow you to return a Promise
from your callback. In this event, the resulting Promise
waits for the
-promise you returned to resolve before adopting its value. This allows for easy composition of promises.
+Most callback registration methods also have versions that allow you to return a Promise
from your callback. In this event, the resulting Promise
waits for the promise you returned to resolve before adopting its value. This allows for easy composition of promises.
showLoadingIndicator()
fetchUserCredentials().flatMap(on: .default) { (credentials) in
// This returns a new promise
@@ -247,25 +221,14 @@ Using Promises
}
-When composing callbacks that return promises, you may run into issues with incompatible error types. There are convenience methods for working with promises
-whose errors are compatible with Error
, but they don’t cover all cases. If you find yourself hitting one of these cases, any Promise
whose error type conforms to
-Error
has a property .upcast
that will convert that error into an Error
to allow for easier composition of promises.
+When composing callbacks that return promises, you may run into issues with incompatible error types. There are convenience methods for working with promises whose errors are compatible with Error
, but they don’t cover all cases. If you find yourself hitting one of these cases, any Promise
whose error type conforms to Error
has a property .upcast
that will convert that error into an Error
to allow for easier composition of promises.
-Tomorrowland also offers a typealias StdPromise<Value>
as shorthand for Promise<T,Error>
. This is frequently useful to avoid having to repeat the types,
-such as with StdPromise(fulfilled: someValue)
instead of Promise<SomeValue,Error>(fulfilled: someValue)
.
+Tomorrowland also offers a typealias StdPromise<Value>
as shorthand for Promise<T,Error>
. This is frequently useful to avoid having to repeat the types, such as with StdPromise(fulfilled: someValue)
instead of Promise<SomeValue,Error>(fulfilled: someValue)
.
Cancelling and Invalidation
-All promises expose a method .requestCancel()
. It is named such because this doesn’t actually guarantee that the promise will be cancelled. If the promise
-supports cancellation, this method will trigger a callback that the promise can use to cancel its work. But promises that don’t support cancellation will ignore this
-and will eventually fulfill or reject as normal. Naturally, requesting cancellation of a promise that has already been resolved does nothing, even if the callbacks have
-not yet been invoked.
-
-In order to handle the issue of a promise being resolved after you no longer care about it, there is a separate mechanism called a PromiseInvalidationToken
-that can be used to suppress callbacks. All callback methods have an optional token
parameter that accepts a PromiseInvalidationToken
. If provided,
-calling invalidate()
on the token prior to the callback being executed guarantees the callback will not fire. If the callback returns a value that is required in order
-to resolve the Promise
returned from the callback registration method, the resulting Promise
is cancelled instead. PromiseInvalidationToken
s can be used
-with multiple callbacks at once, and a single token can be re-used as much as desired. It is recommended that you take advantage of both invalidation tokens and
-cancellation. This may look like
+All promises expose a method .requestCancel()
. It is named such because this doesn’t actually guarantee that the promise will be cancelled. If the promise supports cancellation, this method will trigger a callback that the promise can use to cancel its work. But promises that don’t support cancellation will ignore this and will eventually fulfill or reject as normal. Naturally, requesting cancellation of a promise that has already been resolved does nothing, even if the callbacks have not yet been invoked.
+
+In order to handle the issue of a promise being resolved after you no longer care about it, there is a separate mechanism called a PromiseInvalidationToken
that can be used to suppress callbacks. All callback methods have an optional token
parameter that accepts a PromiseInvalidationToken
. If provided, calling invalidate()
on the token prior to the callback being executed guarantees the callback will not fire. If the callback returns a value that is required in order to resolve the Promise
returned from the callback registration method, the resulting Promise
is cancelled instead. PromiseInvalidationToken
s can be used with multiple callbacks at once, and a single token can be re-used as much as desired. It is recommended that you take advantage of both invalidation tokens and cancellation. This may look like
class URLImageView: UIImageView {
private var promise: StdPromise<Void>?
private let invalidationToken = PromiseInvalidationToken()
@@ -294,19 +257,11 @@ Cancelling and Invalidation
}
-PromiseInvalidationToken
also has a method .requestCancelOnInvalidate(_:)
that can register any number of Promise
s to be automatically
-requested to cancel (using .requestCancel()
) the next time the token is invalidated. Promise
also has the same method (except it takes a token as the
-argument) as a convenience for calling .requestCancelOnInvalidate(_:)
on the token. This can be used to terminate a promise chain without ever assigning
-the promise to a local variable. PromiseInvalidationToken
also has a method .cancelWithoutInvalidating()
which cancels any associated promises
-without invalidating the token.
+PromiseInvalidationToken
also has a method .requestCancelOnInvalidate(_:)
that can register any number of Promise
s to be automatically requested to cancel (using .requestCancel()
) the next time the token is invalidated. Promise
also has the same method (except it takes a token as the argument) as a convenience for calling .requestCancelOnInvalidate(_:)
on the token. This can be used to terminate a promise chain without ever assigning the promise to a local variable. PromiseInvalidationToken
also has a method .cancelWithoutInvalidating()
which cancels any associated promises without invalidating the token.
-By default PromiseInvalidationToken
s will invalidate themselves automatically when deinitialized. This is primarily useful in conjunction with
-requestCancelOnInvalidate(_:)
as it allows you to automatically cancel your promises when object that owns the token deinits. This behavior can be
-disabled with an optional parameter to init
.
+By default PromiseInvalidationToken
s will invalidate themselves automatically when deinitialized. This is primarily useful in conjunction with requestCancelOnInvalidate(_:)
as it allows you to automatically cancel your promises when object that owns the token deinits. This behavior can be disabled with an optional parameter to init
.
-Promise
also has a convenience method requestCancelOnDeinit(_:)
which can be used to request the Promise
to be cancelled when a given object
-deinits. This is equivalent to adding a PromiseInvalidationToken
property to the object (configured to invalidate on deinit) and requesting cancellation when
-the token invalidates, but can be used if the token would otherwise not be explicitly invalidated.
+Promise
also has a convenience method requestCancelOnDeinit(_:)
which can be used to request the Promise
to be cancelled when a given object deinits. This is equivalent to adding a PromiseInvalidationToken
property to the object (configured to invalidate on deinit) and requesting cancellation when the token invalidates, but can be used if the token would otherwise not be explicitly invalidated.
Using these methods, the above loadImage(from:)
can be rewritten as the following including cancellation:
class URLImageView: UIImageView {
@@ -336,17 +291,10 @@ Cancelling and Invalidation
Invalidation token chaining
-PromiseInvalidationToken
s can be arranged in a tree such that invalidating one token will cascade this invalidation down to other tokens. This is
-accomplished by calling childToken.chainInvalidation(from: parentToken)
. Practically speaking this is no different than just manually invalidating each
-child token yourself after invalidating the parent token, but it’s provided as a convenience to make it easy to have fine-grained invalidation control while also having
-a simple way to bulk-invalidate tokens. For example, you might have separate tokens for different view controllers that all chain invalidation from a single token that
-gets invalidated when the user logs out, thus automatically invalidating all your user-dependent network requests at once while still allowing each view controller the
-ability to invalidate just its own requests independently.
+PromiseInvalidationToken
s can be arranged in a tree such that invalidating one token will cascade this invalidation down to other tokens. This is accomplished by calling childToken.chainInvalidation(from: parentToken)
. Practically speaking this is no different than just manually invalidating each child token yourself after invalidating the parent token, but it’s provided as a convenience to make it easy to have fine-grained invalidation control while also having a simple way to bulk-invalidate tokens. For example, you might have separate tokens for different view controllers that all chain invalidation from a single token that gets invalidated when the user logs out, thus automatically invalidating all your user-dependent network requests at once while still allowing each view controller the ability to invalidate just its own requests independently.
TokenPromise
-In order to avoid the repetition of passing a PromiseInvalidationToken
to multiple Promise
methods as well as cancelling the resulting promise, a type
-TokenPromise
exists that handles this for you. You can create a TokenPromise
with the Promise.withToken(_:)
method. This allows you to take code like
-the following:
+In order to avoid the repetition of passing a PromiseInvalidationToken
to multiple Promise
methods as well as cancelling the resulting promise, a type TokenPromise
exists that handles this for you. You can create a TokenPromise
with the Promise.withToken(_:)
method. This allows you to take code like the following:
func loadModel() {
promiseToken.invalidate()
MyModel.fetchFromNetworkAsPromise()
@@ -372,30 +320,16 @@ PromiseInvalidationToken
‘s
-requestCancelOnInvalidate(_:)
if you want to be able to cancel the promise later.
+
Nearly all callback registration methods will automatically propagate cancellation requests from the child to the parent if the parent has no other observers. If all observers for a promise request cancellation, the cancellation request will propagate upwards at this time. This means that a promise will not automatically cancel as long as there’s at least one interested observer. Do note that promises that have no observers do not get automatically cancelled, this only happens if there’s at least one observer (which then requests cancellation). Automatic cancellation propagation also requires that the promise itself no longer be in scope. For this reason you should avoid holding onto promises long-term and instead use the .cancellable
property or PromiseInvalidationToken
‘s requestCancelOnInvalidate(_:)
if you want to be able to cancel the promise later.
-Automatic cancellation propagation also works with the utility functions when(fulfilled:)
and when(first:)
as well as the convenience methods
-timeout(on:delay:)
and delay(on:_:)
.
+Automatic cancellation propagation also works with the utility functions when(fulfilled:)
and when(first:)
as well as the convenience methods timeout(on:delay:)
and delay(on:_:)
.
-Promises have a couple of methods that do not participate in automatic cancellation propagation. You can use tap(on:token:_:)
as an alternative to always
in
-order to register an observer that won’t interfere with the existing automatic cancellation propagation (this is suitable for inserting into the middle of a promise
-chain). You can also use tap()
as a more generic version of this.
+Promises have a couple of methods that do not participate in automatic cancellation propagation. You can use tap(on:token:_:)
as an alternative to always
in order to register an observer that won’t interfere with the existing automatic cancellation propagation (this is suitable for inserting into the middle of a promise chain). You can also use tap()
as a more generic version of this.
Note that ignoringCancel()
disables automatic cancellation propagation on the receiver. Once you invoke this on a promise, it will never automatically cancel.
propagatingCancellation(on:cancelRequested:)
-In some cases you may need to hold onto a promise without blocking cancellation propagation from its children. The primary use-case here is deduplicating access to
-an asynchronous resource (such as a network load). In this scenario you may wish to hold onto a promise and return a new child for every client requesting the same
-resource, without preventing cancellation of the resource load if all clients cancel their requests. This can be accomplished by holding onto the result of calling
-.propagatingCancellation(on:cancelRequested:)
. The promise returned from this method will propagate cancellation to its parent as soon as all children
-have requested cancellation even if the promise is still in scope. When cancellation is requested, the cancelRequested
handler will be invoked immediately prior to
-propagating cancellation upwards; this enables you to release your reference to the promise (so a new request by a client will create a brand new resource load). An
-example of this might look like:
+In some cases you may need to hold onto a promise without blocking cancellation propagation from its children. The primary use-case here is deduplicating access to an asynchronous resource (such as a network load). In this scenario you may wish to hold onto a promise and return a new child for every client requesting the same resource, without preventing cancellation of the resource load if all clients cancel their requests. This can be accomplished by holding onto the result of calling .propagatingCancellation(on:cancelRequested:)
. The promise returned from this method will propagate cancellation to its parent as soon as all children have requested cancellation even if the promise is still in scope. When cancellation is requested, the cancelRequested
handler will be invoked immediately prior to propagating cancellation upwards; this enables you to release your reference to the promise (so a new request by a client will create a brand new resource load). Returning a new child to each client can be done using makeChild()
. An example of this might look like:
func loadResource(at url: URL) {
let promise: StdPromise<Model>
if let existingPromise = resourceLoads[url] {
@@ -409,24 +343,16 @@ resourceLoads[url] = promise
}
// Return a new child for each request so all clients have to cancel, not just one.
- return promise.then(on: .immediate, { _ in })
+ return promise.makeChild()
}
The special .nowOr(_:)
context
-There is a special context PromiseContext.nowOr(_:)
that behaves a bit differently than other contexts. This context is special in that its callback executes
-differently depending on whether the promise it’s being registered on has already resolved by the time the callback is registered. If the promise has already
-resolved then .nowOr(context)
behaves like .immediate
, otherwise it behaves like the wrapped context
. This context is intended to be used to replace
-code that would otherwise check if the promise.result
is non-nil
prior to registering a callback.
+There is a special context PromiseContext.nowOr(_:)
that behaves a bit differently than other contexts. This context is special in that its callback executes differently depending on whether the promise it’s being registered on has already resolved by the time the callback is registered. If the promise has already resolved then .nowOr(context)
behaves like .immediate
, otherwise it behaves like the wrapped context
. This context is intended to be used to replace code that would otherwise check if the promise.result
is non-nil
prior to registering a callback.
-If this context is used in Promise.init(on:_:)
it always behaves like .immediate
, and if it’s used in DelayedPromise.init(on:_:)
it always behaves
-like the wrapped context.
+If this context is used in Promise.init(on:_:)
it always behaves like .immediate
, and if it’s used in DelayedPromise.init(on:_:)
it always behaves like the wrapped context.
-There is a property PromiseContext.isExecutingNow
that can be accessed from within a callback registered with .nowOr(_:)
to determine if the callback
-is executing synchronously or asynchronously. When accessed from any other context it returns false
. When registering a callback with .immediate
from
-within a callback where PromiseContext.isExecutingNow
is true
, the nested callback will inherit the PromiseContext.isExecutingNow
flag if and only
-if the nested callback is also executing synchronously. This is a bit subtle but is intended to allow Promise(on: .immediate, { … })
to inherit the flag from
-its surrounding scope.
+There is a property PromiseContext.isExecutingNow
that can be accessed from within a callback registered with .nowOr(_:)
to determine if the callback is executing synchronously or asynchronously. When accessed from any other context it returns false
. When registering a callback with .immediate
from within a callback where PromiseContext.isExecutingNow
is true
, the nested callback will inherit the PromiseContext.isExecutingNow
flag if and only if the nested callback is also executing synchronously. This is a bit subtle but is intended to allow Promise(on: .immediate, { … })
to inherit the flag from its surrounding scope.
An example of how this context might be used is when populating an image view from a network request:
createNetworkRequestAsPromise()
@@ -445,41 +371,28 @@ Promise Helpers
There are a few helper functions that can be used to deal with multiple promises.
when(fulfilled:)
-when(fulfilled:)
is a global function that takes either an array of promises or 2–6 promises as separate arguments, and returns a single promise that is
-eventually fulfilled with the values of all input promises. With the array version all input promises must have the same type and the result is fulfilled with an array.
-With the separate argument version the promises may have unique value types (but the same error type) and the result is fulfilled with a tuple.
+when(fulfilled:)
is a global function that takes either an array of promises or 2–6 promises as separate arguments, and returns a single promise that is eventually fulfilled with the values of all input promises. With the array version all input promises must have the same type and the result is fulfilled with an array. With the separate argument version the promises may have unique value types (but the same error type) and the result is fulfilled with a tuple.
-If any of the input promises is rejected or cancelled, the resulting promise is immediately rejected or cancelled as well. If multiple input promises are rejected or
-cancelled, the first such one affects the result.
+If any of the input promises is rejected or cancelled, the resulting promise is immediately rejected or cancelled as well. If multiple input promises are rejected or cancelled, the first such one affects the result.
This function has an optional parameter cancelOnFailure:
that, if provided as true
, will cancel all input promises if any of them are rejected.
when(first:)
-when(first:)
is a global function that takes an array of promises of the same type, and returns a single promise that eventually adopts the same value or error as
-the first input promise that gets fulfilled or rejected. Cancelled input promises are ignored, unless all input promsies are cancelled, at which point the resulting
-promise will be cancelled as well.
+when(first:)
is a global function that takes an array of promises of the same type, and returns a single promise that eventually adopts the same value or error as the first input promise that gets fulfilled or rejected. Cancelled input promises are ignored, unless all input promsies are cancelled, at which point the resulting promise will be cancelled as well.
-This function has an optional parameter cancelRemaining:
that, if provided as true
, will cancel the remaining input promises as soon as one of them is fulfilled
-or rejected.
+This function has an optional parameter cancelRemaining:
that, if provided as true
, will cancel the remaining input promises as soon as one of them is fulfilled or rejected.
Promise.timeout(on:delay:)
-Promise.timeout(on:delay:)
is a method that returns a new promise that adopts the same value as the receiver, or is rejected with an error if the receiver isn’t
-resolved within the given interval.
+Promise.timeout(on:delay:)
is a method that returns a new promise that adopts the same value as the receiver, or is rejected with an error if the receiver isn’t resolved within the given interval.
Promise.delay(on:_:)
-Promise.delay(on:_:)
is a method that returns a new promise that adopts the same result as the receiver after the specified delay. It is intended primarily for
-testing purposes.
+Promise.delay(on:_:)
is a method that returns a new promise that adopts the same result as the receiver after the specified delay. It is intended primarily for testing purposes.
Objective-C
-Tomorrowland has Obj-C compatibility in the form of TWLPromise<ValueType,ErrorType>
. This is a parallel promise implementation that can be bridged to/from
-Promise
and supports all of the same functionality. Note that some of the method names are different (due to lack of overloading), and while TWLPromise
is
-generic over its types, the return values of callback registration methods that return new promises are not parameterized (due to inability to have generic methods).
+Tomorrowland has Obj-C compatibility in the form of TWLPromise<ValueType,ErrorType>
. This is a parallel promise implementation that can be bridged to/from Promise
and supports all of the same functionality. Note that some of the method names are different (due to lack of overloading), and while TWLPromise
is generic over its types, the return values of callback registration methods that return new promises are not parameterized (due to inability to have generic methods).
Callback lifetimes
-Callbacks registered on promises will be retained until the promise is resolved. If a callback is invoked (or would be invoked if the relevant invalidation token hadn’t
-been invalidated), Tomorrowland guarantees that it will release the callback on the context it was invoked on. If the callback is not invoked (e.g. it’s a then(on:_:)
-callback but the promise was rejected) then no guarantees are made as to the context the callback is released on. If you need to ensure it’s released on the
-appropriate context (e.g. if it captures an object that must deallocate on the main thread) then you can use .always
or one of the .mapResult
variants.
+Callbacks registered on promises will be retained until the promise is resolved. If a callback is invoked (or would be invoked if the relevant invalidation token hadn’t been invalidated), Tomorrowland guarantees that it will release the callback on the context it was invoked on. If the callback is not invoked (e.g. it’s a then(on:_:)
callback but the promise was rejected) then no guarantees are made as to the context the callback is released on. If you need to ensure it’s released on the appropriate context (e.g. if it captures an object that must deallocate on the main thread) then you can use .always
or one of the .mapResult
variants.
Requirements
Requires a minimum of iOS 9, macOS 10.10, watchOS 2.0, or tvOS 9.0.
@@ -497,25 +410,32 @@ Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.
Version History
+v1.4.0
+
+
+- Fix the cancellation propagation behavior of
Promise.Resolver.resolve(with:)
and the flatMap
family of methods. Previously, requesting cancellation of the promise associated with the resolver (for resolve(with:)
, or the returned promise for the flatMap
family) would immediately request cancellation of the upstream promise even if the upstream promise had other children. The new behavior fixes this such that it participates in automatic cancellation propagation just like any other child promise (#54).
+- Slightly optimize stack usage when chaining one promise to another.
+- Avoid using stack space for chained promises that don’t involve a callback. For example, when the promise returned from a
flatMap(on:token:_:)
resolves it will resolve the outer promise without using additional stack frames. You can think of it like tail calling functions. This affects not just flatMap
but also operations such as tap()
, ignoringCancel()
, and more. This also applies to Obj-C (with TWLPromise
).
+
+
+Note: This does not affect the variants that implicitly upcast from some E: Swift.Error
to Swift.Error
such as tryFlatMap(on:token:_:)
.
+
+
+- Change cancellation propagation behavior of
onCancel
. Like tap
, it doesn’t prevent automatic cancellation propagation if the parent has other children and all other children request cancellation. Unlike tap
, requesting cancellation of onCancel
when there are no other children will propagate cancellation to the parent. The motivation here is attaching an onCancel
observer shouldn’t prevent cancellation that would otherwise occur, but when it’s the only child it should behave like the other standard observers (#57).
+- Add method
Promise.makeChild()
. This returns a new child of the receiver that adopts the receiver’s value and propagates cancellation like any other observer. The purpose here is to be used when handing back multiple children of one parent to callers, as handing back the parent means any one caller can cancel it without the other callers’ participation. This is particularly useful in conjunction with propagatingCancellation(on:cancelRequested:)
(#56).
+
v1.3.0
-- Add
PromiseContext.isExecutingNow
(TWLPromiseContext.isExecutingNow
in Obj-C) that returns true
if accessed from within a callback registered
-with .nowOr(_:)
and executing synchronously, or false
otherwise. If accessed from within a callback (or Promise.init(on:_:)
) registered with
-.immediate
and running synchronously, it inherits the surrounding scope’s PromiseContext.isExecutingNow
flag. This is intended to allow
-Promise(on: .immediate, { … })
to query the surrounding scope’s flag (#53).
+- Add
PromiseContext.isExecutingNow
(TWLPromiseContext.isExecutingNow
in Obj-C) that returns true
if accessed from within a callback registered with .nowOr(_:)
and executing synchronously, or false
otherwise. If accessed from within a callback (or Promise.init(on:_:)
) registered with .immediate
and running synchronously, it inherits the surrounding scope’s PromiseContext.isExecutingNow
flag. This is intended to allow Promise(on: .immediate, { … })
to query the surrounding scope’s flag (#53).
- Add convenience methods to Obj-C for doing then+catch together, as this is a common pattern and chaining Obj-C methods is a little awkward (#45).
-- Change
Promise.timeout
’s default context to .nowOr(.auto)
for the Error
overload as well.
-- Change the behavior of
Promise.timeout(on:delay:)
when the delay
is less than or equal to zero, the context
is .immediate
or .nowOr(_:)
, and the
-upstream promise hasn’t resolved yet. Previously the timeout would occur asynchronously and the upstream promise would get a chance to race the timeout. With
-the new behavior the timeout occurs synchronously (#49).
+- Change
Promise.timeout
‘s default context to .nowOr(.auto)
for the Error
overload as well.
+- Change the behavior of
Promise.timeout(on:delay:)
when the delay
is less than or equal to zero, the context
is .immediate
or .nowOr(_:)
, and the upstream promise hasn’t resolved yet. Previously the timeout would occur asynchronously and the upstream promise would get a chance to race the timeout. With the new behavior the timeout occurs synchronously (#49).
v1.2.0
-- Add
PromiseContext.nowOr(context)
(+[TWLContext nowOrContext:]
in Obj-C) that runs the callback synchronously when registered if the promise
-has already resolved, otherwise registers the callback to run on context
. This can be used to replace code that previously would have required checking
-promise.result
prior to registering the callback (#34).
+- Add
PromiseContext.nowOr(context)
(+[TWLContext nowOrContext:]
in Obj-C) that runs the callback synchronously when registered if the promise has already resolved, otherwise registers the callback to run on context
. This can be used to replace code that previously would have required checking promise.result
prior to registering the callback (#34).
For example:
@@ -525,30 +445,20 @@ v1.2.0
-- Add
Promise.Resolver.hasRequestedCancel
(TWLResolver.cancelRequested
in Obj-C) that returns true
if the promise has been requested to
-cancel or is already cancelled, or false
if it hasn’t been requested to cancel or is fulfilled or rejected. This can be used when a promise initializer takes
-significant time in a manner not easily interrupted by an onRequestCancel
handler (#47).
-- Change
Promise.timeout
’s default context from .auto
to .nowOr(.auto)
. This behaves the same as .auto
in most cases, except if the receiver has
-already been resolved this will cause the returned promise to likewise already be resolved (#50).
-- Ensure
when(first:cancelRemaining:)
returns an already-cancelled promise if all input promises were previously cancelled, instead of cancelling the
-returned promise asynchronously (#51).
-- Ensure
when(fulfilled:qos:cancelOnFailure:)
returns an already-resolved promise if either all input promises were previously fulfliled or any input
-promise was previously rejected or cancelled (#52).
+- Add
Promise.Resolver.hasRequestedCancel
(TWLResolver.cancelRequested
in Obj-C) that returns true
if the promise has been requested to cancel or is already cancelled, or false
if it hasn’t been requested to cancel or is fulfilled or rejected. This can be used when a promise initializer takes significant time in a manner not easily interrupted by an onRequestCancel
handler (#47).
+- Change
Promise.timeout
’s default context from .auto
to .nowOr(.auto)
. This behaves the same as .auto
in most cases, except if the receiver has already been resolved this will cause the returned promise to likewise already be resolved (#50).
+- Ensure
when(first:cancelRemaining:)
returns an already-cancelled promise if all input promises were previously cancelled, instead of cancelling the returned promise asynchronously (#51).
+- Ensure
when(fulfilled:qos:cancelOnFailure:)
returns an already-resolved promise if either all input promises were previously fulfliled or any input promise was previously rejected or cancelled (#52).
v1.1.1
-- Fix memory leaks in
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
and
-PromiseInvalidationToken.chainInvalidation(from:includingCancelWithoutInvalidating:)
when cleaning up nil
nodes prior to pushing on the
-new node (#48).
+- Fix memory leaks in
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
and PromiseInvalidationToken.chainInvalidation(from:includingCancelWithoutInvalidating:)
when cleaning up nil
nodes prior to pushing on the new node (#48).
v1.1.0
-- Add new method
.propagatingCancellation(on:cancelRequested:)
that can be used to create a long-lived promise that propagates cancellation from its
-children to its parent while it’s still alive. Normally promises don’t propagate cancellation until they themselves are released, in case more children are going to be
-added. This new method is intended to be used when deduplicating requests for an asynchronous resource (such as a network load) such that the resource request
-can be cancelled in the event that no children care about it anymore (#46).
+- Add new method
.propagatingCancellation(on:cancelRequested:)
that can be used to create a long-lived promise that propagates cancellation from its children to its parent while it’s still alive. Normally promises don’t propagate cancellation until they themselves are released, in case more children are going to be added. This new method is intended to be used when deduplicating requests for an asynchronous resource (such as a network load) such that the resource request can be cancelled in the event that no children care about it anymore (#46).
v1.0.1
@@ -558,27 +468,18 @@ v1.0.1
v1.0.0
-- Fix a rather serious bug where
PromiseInvalidationToken
s would not deinit as long as any promise whose callback was tied to the token was still unresolved.
-This meant that the default invalidateOnDeinit
behavior would not trigger and the callback would still fire even though there were no more external references
-to the token, and this meant any promises configured to be cancelled when the promise invalidated would not cancel. Tokens used purely for
-requestCancelOnInvalidate(_:)
would still deallocate, and tokens would still deallocate after any associated promises had resolved.
-- Tweak the atomic memory ordering used in
PromiseInvalidationToken
s. After a careful re-reading I don’t believe I was issuing the correct fences previously,
-making it possible for tokens whose associated promise callbacks were executing concurrently with a call to requestCancelOnInvalidate(_:)
to read the
-wrong generation value, and for tokens that had requestCancelOnInvalidate(_:)
invoked concurrently on multiple threads to corrupt the generation.
-- Add
PromiseInvalidationToken.chainInvalidation(from:)
to invalidate a token whenever another token invalidates. This allows for building a tree of
-tokens in order to have both fine-grained and bulk invalidation at the same time. Tokens chained together this way stay chained forever (#43).
-- Update project file to Swift 5.0. The source already supported this. This change should only affect people using Carthage or anyone adding building this
-framework from source.
-- Update the podspec to list both Swift 4.2 and Swift 5.0. With CocoaPods 1.7.0 or later your
Podfile
can now declare which version of Swift it’s compatible with.
-For anyone using CocoaPods 1.6 or earlier it will default to Swift 5.0.
+- Fix a rather serious bug where
PromiseInvalidationToken
s would not deinit as long as any promise whose callback was tied to the token was still unresolved. This meant that the default invalidateOnDeinit
behavior would not trigger and the callback would still fire even though there were no more external references to the token, and this meant any promises configured to be cancelled when the promise invalidated would not cancel. Tokens used purely for requestCancelOnInvalidate(_:)
would still deallocate, and tokens would still deallocate after any associated promises had resolved.
+- Tweak the atomic memory ordering used in
PromiseInvalidationToken
s. After a careful re-reading I don’t believe I was issuing the correct fences previously, making it possible for tokens whose associated promise callbacks were executing concurrently with a call to requestCancelOnInvalidate(_:)
to read the wrong generation value, and for tokens that had requestCancelOnInvalidate(_:)
invoked concurrently on multiple threads to corrupt the generation.
+- Add
PromiseInvalidationToken.chainInvalidation(from:)
to invalidate a token whenever another token invalidates. This allows for building a tree of tokens in order to have both fine-grained and bulk invalidation at the same time. Tokens chained together this way stay chained forever (#43).
+- Update project file to Swift 5.0. The source already supported this. This change should only affect people using Carthage or anyone adding building this framework from source.
+- Update the podspec to list both Swift 4.2 and Swift 5.0. With CocoaPods 1.7.0 or later your
Podfile
can now declare which version of Swift it’s compatible with. For anyone using CocoaPods 1.6 or earlier it will default to Swift 5.0.
v0.6.0
- Make
DelayedPromise
conform to Equatable
(#37).
- Add convenience functions for working with
Swift.Result
(#39).
-- Mark all the deprecated functions as unavailable instead. This restores the ability to write code like
promise.then({ foo?($0) })
without it incorrectly
-resolving to the deprecated form of map(_:)
(#35).
+- Mark all the deprecated functions as unavailable instead. This restores the ability to write code like
promise.then({ foo?($0) })
without it incorrectly resolving to the deprecated form of map(_:)
(#35).
- Rename
Promise.init(result:)
and Promise.init(on:result:after:)
to Promise.init(with:)
and Promise.init(on:with:after:)
(#40).
v0.5.1
@@ -588,28 +489,23 @@ v0.5.1
Ensure that if a user-supplied callback is invoked, it is also released on the context where it was invoked (#38).
-This guarantee is only made for callbacks that are invoked (ignoring tokens). What this means is when using e.g. .then(on:_:)
if the promise is fulfilled, the
- onSuccess
block will be released on the provided context, but if the promise is rejected no such guarantee is made. If you rely on the context it’s released on
- (e.g. it captures an object that must deallocate on the main thread) then you can use .always
or one of the mapResult
variants.
+This guarantee is only made for callbacks that are invoked (ignoring tokens). What this means is when using e.g. .then(on:_:)
if the promise is fulfilled, the onSuccess
block will be released on the provided context, but if the promise is rejected no such guarantee is made. If you rely on the context it’s released on (e.g. it captures an object that must deallocate on the main thread) then you can use .always
or one of the mapResult
variants.
v0.5.0
- Rename a lot of methods on
Promise
and TokenPromise
(#5).
-This gets rid of most overrides, leaving the only overridden methods to be ones that handle either Swift.Error
or E: Swift.Error
, and even these overrides
- are removed in the Swift 5 compiler.
+This gets rid of most overrides, leaving the only overridden methods to be ones that handle either Swift.Error
or E: Swift.Error
, and even these overrides are removed in the Swift 5 compiler.
-then
is now map
or flatMap
, recover
’s override is now flatMapError
, always
’s override is now flatMapResult
, and similar renames were made for
- the try
variants.
+then
is now map
or flatMap
, recover
’s override is now flatMapError
, always
’s override is now flatMapResult
, and similar renames were made for the try
variants.
- Add a new
then
method whose block returns Void
. The returned promise resolves to the same result as the original promise.
- Add new
mapError
and tryMapError
methods.
- Add new
mapResult
and tryMapResult
methods.
- Extend
tryFlatMapError
to be available on all Promise
s instead of just those whose error type is Swift.Error
.
-- Remove the default
.auto
value for the on context:
parameter to most calls. It’s now only provided for the “terminal” callbacks, the ones that don’t return a
-value from the handler. This avoids the common problem of running trivial maps on the main thread unnecessarily (#33).
+- Remove the default
.auto
value for the on context:
parameter to most calls. It’s now only provided for the “terminal” callbacks, the ones that don’t return a value from the handler. This avoids the common problem of running trivial maps on the main thread unnecessarily (#33).
v0.4.3
@@ -629,23 +525,16 @@ v0.4.1
v0.4
-- Improve the behavior of
.delay(on:_:)
and .timeout(on:delay:)
when using PromiseContext.operationQueue
. The relevant operation is now added
-to the queue immediately and only becomes ready once the delay/timeout has elapsed.
+- Improve the behavior of
.delay(on:_:)
and .timeout(on:delay:)
when using PromiseContext.operationQueue
. The relevant operation is now added to the queue immediately and only becomes ready once the delay/timeout has elapsed.
- Add
-[TWLPromise initCancelled]
to construct a pre-cancelled promise.
-- Add
Promise.init(on:fulfilled:after:)
, Promise.init(on:rejected:after:)
, and Promise.init(on:result:after:)
. These initializers produce
-something akin to Promise(fulfilled: value).delay(after)
except they respond to cancellation immediately. This makes them more suitable for use as
-cancellable timers, as opposed to .delay(_:)
which is more intended for debugging (#27).
-- Try to clean up the callback list when calling
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
. Any deallocated promises at the head of the
-callback list will be removed. This will help keep the callback list from growing uncontrollably when a token is used merely to cancel all promises when the owner
-deallocates as opposed to being periodically invalidated during its lifetime (#25).
-- Cancel the
.delay(_:)
timer if .requestCancel()
is invoked and the upstream promise cancelled. This way requested cancels will skip the delay, but
-unexpected cancels will still delay the result (#26).
+- Add
Promise.init(on:fulfilled:after:)
, Promise.init(on:rejected:after:)
, and Promise.init(on:result:after:)
. These initializers produce something akin to Promise(fulfilled: value).delay(after)
except they respond to cancellation immediately. This makes them more suitable for use as cancellable timers, as opposed to .delay(_:)
which is more intended for debugging (#27).
+- Try to clean up the callback list when calling
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
. Any deallocated promises at the head of the callback list will be removed. This will help keep the callback list from growing uncontrollably when a token is used merely to cancel all promises when the owner deallocates as opposed to being periodically invalidated during its lifetime (#25).
+- Cancel the
.delay(_:)
timer if .requestCancel()
is invoked and the upstream promise cancelled. This way requested cancels will skip the delay, but unexpected cancels will still delay the result (#26).
v0.3.4
-- Add
PromiseInvalidationToken.cancelWithoutInvalidating()
. This method cancels any associated promises without invalidating the token, thus
-allowing for any onCancel
and always
handlers on the promises to fire (#23).
+- Add
PromiseInvalidationToken.cancelWithoutInvalidating()
. This method cancels any associated promises without invalidating the token, thus allowing for any onCancel
and always
handlers on the promises to fire (#23).
- Add missing
Promise
↔ObjCPromise
bridging methods for the case of Value: AnyObject, Error == Swift.Error
(#24).
v0.3.3
@@ -676,8 +565,7 @@ v0.3
- Add
Promise.requestCancelOnInvalidate(_:)
as a convenience for token.requestCancelOnInvalidate(_:)
.
- Add
Promise.requestCancelOnDeinit(_:)
as a convenience for adding a token property to an object that invalites on deinit.
-- Better support for
OperationQueue
with delay
/timeout
. Instead of using the OperationQueue
’s underlying queue, we instead use a .userInitiated
-queue for the timer and hop onto the OperationQueue
to resolve the promise.
+- Better support for
OperationQueue
with delay
/timeout
. Instead of using the OperationQueue
’s underlying queue, we instead use a .userInitiated
queue for the timer and hop onto the OperationQueue
to resolve the promise.
v0.2
@@ -693,7 +581,7 @@ v0.1
diff --git a/docs/search.json b/docs/search.json
index 10637b2..3a649da 100644
--- a/docs/search.json
+++ b/docs/search.json
@@ -1 +1 @@
-{"Typealiases.html#/s:12Tomorrowland17StdDelayedPromisea":{"name":"StdDelayedPromise","abstract":"StdDelayedPromise
is an alias for a DelayedPromise
whose error type is Swift.Error
.
"},"Typealiases.html#/s:12Tomorrowland10StdPromisea":{"name":"StdPromise","abstract":"StdPromise
is an alias for a Promise
whose error type is Swift.Error
.
"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5innerAA0C0Vyxq_Gvp":{"name":"inner","abstract":"The wrapped Promise
.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5tokenAA0c12InvalidationB0Vvp":{"name":"token","abstract":"The PromiseInvalidationToken
to use when invoking methods on the wrapped Promise
.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7promise5tokenACyxq_GAA0C0Vyxq_G_AA0c12InvalidationB0Vtcfc":{"name":"init(promise:token:)","abstract":"Returns a new TokenPromise
that wraps the given promise.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV4then2on_ACyxq_GAA0C7ContextO_yxctF":{"name":"then(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3map2on_ACyqd__q_GAA0C7ContextO_qd__xctlF":{"name":"map(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7flatMap2on_ACyqd__q_GAA0C7ContextO_AA0C0Vyqd__q_GxctlF":{"name":"flatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5catch2on_ACyxq_GAA0C7ContextO_yq_ctF":{"name":"catch(on:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7recover2on_ACyxAA7NoErrorOGAA0C7ContextO_xq_ctF":{"name":"recover(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV8mapError2on_ACyxqd__GAA0C7ContextO_qd__q_ctlF":{"name":"mapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV12flatMapError2on_ACyxqd__GAA0C7ContextO_AA0C0Vyxqd__Gq_ctlF":{"name":"flatMapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV11tryMapError2on_ACyxs0F0_pGAA0C7ContextO_qd__q_KctsAFRd__lF":{"name":"tryMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV15tryFlatMapError2on_ACyxs0G0_pGAA0C7ContextO_AA0C0Vyxqd__Gq_KctsAFRd__lF":{"name":"tryFlatMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryMapError(on:_:)":{"name":"tryMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMapError(on:_:)":{"name":"tryFlatMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV6always2on_ACyxq_GAA0C7ContextO_yAA0C6ResultOyxq_GctF":{"name":"always(on:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV9mapResult2on0F8CompleteACyqd__qd_0_GAA0C7ContextO_AA0cE0Oyqd__qd_0_GAKyxq_Gctr0_lF":{"name":"mapResult(on:onComplete:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV13flatMapResult2on_ACyqd__qd_0_GAA0C7ContextO_AA0C0Vyqd__qd_0_GAA0cF0Oyxq_Gctr0_lF":{"name":"flatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV12tryMapResult2on_ACyqd__s5Error_pGAA0C7ContextO_AA0cF0Oyqd__qd_0_GAKyxq_GKctsAFRd_0_r0_lF":{"name":"tryMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV16tryFlatMapResult2on_ACyqd__s5Error_pGAA0C7ContextO_AA0C0Vyqd__qd_0_GAA0cG0Oyxq_GKctsAFRd_0_r0_lF":{"name":"tryFlatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryMapResult(on:_:)":{"name":"tryMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMapResult(on:_:)":{"name":"tryFlatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3tap2on_ACyxq_GAA0C7ContextO_yAA0C6ResultOyxq_GctF":{"name":"tap(on:_:)","abstract":"
Registers a callback that will be invoked when the promise is resolved without affecting behavior.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3tapACyxq_GyF":{"name":"tap()","abstract":"Returns a new TokenPromise
that adopts the result of the receiver without affecting its","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV8onCancel0D0_ACyxq_GAA0C7ContextO_yyctF":{"name":"onCancel(on:_:)","abstract":"
Registers a callback that will be invoked when the promise is cancelled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV4forkyACyxq_GyAEKXEKF":{"name":"fork(_:)","abstract":"Passes the TokenPromise
to a block and then returns the TokenPromise
for further","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV14ignoringCancelACyxq_GyF":{"name":"ignoringCancel()","abstract":"
Returns a new TokenPromise
that adopts the value of the receiver but ignores cancel","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"
Two TokenPromise
s compare as equal if they represent the same promise.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE7tryThen2on_ACyxsAD_pGAA0C7ContextO_yxKctF":{"name":"tryThen(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE6tryMap2on_ACyqd__sAD_pGAA0C7ContextO_qd__xKctlF":{"name":"tryMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMap(on:_:)":{"name":"tryFlatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE10tryFlatMap2on_ACyqd__sAD_pGAA0C7ContextO_AA0C0Vyqd__qd_0_GxKctsADRd_0_r0_lF":{"name":"tryFlatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE10tryRecover2on_ACyxsAD_pGAA0C7ContextO_xsAD_pKctF":{"name":"tryRecover(on:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE010tryFlatMapD02on_ACyxsAD_pGAA0C7ContextO_AA0C0Vyxqd__GsAD_pKctsADRd__lF":{"name":"tryFlatMapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV18invalidateOnDeinitACSb_tcfc":{"name":"init(invalidateOnDeinit:)","abstract":"Creates and returns a new PromiseInvalidationToken
.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV10invalidateyyF":{"name":"invalidate()","abstract":"Invalidates the token and cancels any associated promises.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25cancelWithoutInvalidatingyyF":{"name":"cancelWithoutInvalidating()","abstract":"Cancels any associated promises without invalidating the token.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25requestCancelOnInvalidateyyAA0B0Vyxq_Gr0_lF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Registers a Promise
to be requested to cancel automatically when the token is invalidated.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25requestCancelOnInvalidateyySo10TWLPromiseCyxq_GRlzCRl_Cr0_lF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Registers an ObjCPromise
to be requested to cancel automatically when the token is","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV05chainC04from34includingCancelWithoutInvalidatingyAC_SbtF":{"name":"chainInvalidation(from:includingCancelWithoutInvalidating:)","abstract":"
Invalidates the token whenever another token is invalidated.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:s28CustomDebugStringConvertibleP16debugDescriptionSSvp":{"name":"debugDescription","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseInvalidationToken"},"Structs/PromiseCancellable.html#/s:12Tomorrowland18PromiseCancellableV13requestCancelyyF":{"name":"requestCancel()","abstract":"Requests cancellation of the promise this PromiseCancellable
was created from.
","parent_name":"PromiseCancellable"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7fulfill4withyx_tF":{"name":"fulfill(with:)","abstract":"Fulfills the promise with the given value.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV6reject4withyq__tF":{"name":"reject(with:)","abstract":"Rejects the promise with the given error.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV6cancelyyF":{"name":"cancel()","abstract":"Cancels the promise.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7resolve4withyAA0B6ResultOyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7resolve4withyACyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with another promise.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV15onRequestCancel0D0_yAA0B7ContextO_yAEyxq__GctF":{"name":"onRequestCancel(on:_:)","abstract":"Registers a block that will be invoked if requestCancel()
is invoked on the promise","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV18hasRequestedCancelSbvp":{"name":"hasRequestedCancel","abstract":"
Returns whether the promise has already been requested to cancel.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5Error_pRs_rlE7resolve4withyAA0B6ResultOyxqd__G_tsAFRd__lF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5Error_pRs_rlE14handleCallback08isCancelD0yxSg_sAF_pSgtcSbsAF_pc_tF":{"name":"handleCallback(isCancelError:)","abstract":"Convenience method for handling framework callbacks.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5ErrorR_rlE7resolve4withys6ResultOyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html":{"name":"Resolver","abstract":"A Resolver
is used to fulfill, reject, or cancel its associated Promise
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6resultAA0B6ResultOyxq_GSgvp":{"name":"result","abstract":"Returns the result of the promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV16makeWithResolverACyxq_G_AC0E0Vyxq__GtyFZ":{"name":"makeWithResolver()","abstract":"Returns a Promise
and a Promise.Resolver
that can be used to fulfill that promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on_ACyxq_GAA0B7ContextO_yAC8ResolverVyxq__Gctcfc":{"name":"init(on:_:)","abstract":"Returns a new Promise
that will be resolved using the given block.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9fulfilledACyxq_Gx_tcfc":{"name":"init(fulfilled:)","abstract":"Returns a Promise
that is already fulfilled with the given value.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8rejectedACyxq_Gq__tcfc":{"name":"init(rejected:)","abstract":"Returns a Promise
that is already rejected with the given error.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4withACyxq_GAA0B6ResultOyxq_G_tcfc":{"name":"init(with:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4then2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyxctF":{"name":"then(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3map2on5token_ACyqd__q_GAA0B7ContextO_AA0B17InvalidationTokenVSgqd__xctlF":{"name":"map(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7flatMap2on5token_ACyqd__q_GAA0B7ContextO_AA0B17InvalidationTokenVSgAGxctlF":{"name":"flatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV5catch2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyq_ctF":{"name":"catch(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7recover2on5token_ACyxAA7NoErrorOGAA0B7ContextO_AA0B17InvalidationTokenVSgxq_ctF":{"name":"recover(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8mapError2on5token_ACyxqd__GAA0B7ContextO_AA0B17InvalidationTokenVSgqd__q_ctlF":{"name":"mapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV12flatMapError2on5token_ACyxqd__GAA0B7ContextO_AA0B17InvalidationTokenVSgAGq_ctlF":{"name":"flatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV11tryMapError2on5token_ACyxs0E0_pGAA0B7ContextO_AA0B17InvalidationTokenVSgqd__q_KctsAGRd__lF":{"name":"tryMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV15tryFlatMapError2on5token_ACyxs0F0_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyxqd__Gq_KctsAGRd__lF":{"name":"tryFlatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/tryMapError(on:token:_:)":{"name":"tryMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMapError(on:token:_:)":{"name":"tryFlatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6always2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyAA0B6ResultOyxq_GctF":{"name":"always(on:token:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9mapResult2on5token_ACyqd__qd_0_GAA0B7ContextO_AA0B17InvalidationTokenVSgAA0bD0Oyqd__qd_0_GANyxq_Gctr0_lF":{"name":"mapResult(on:token:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV13flatMapResult2on5token_ACyqd__qd_0_GAA0B7ContextO_AA0B17InvalidationTokenVSgAgA0bE0Oyxq_Gctr0_lF":{"name":"flatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV12tryMapResult2on5token_ACyqd__s5Error_pGAA0B7ContextO_AA0B17InvalidationTokenVSgAA0bE0Oyqd__qd_0_GAOyxq_GKctsAGRd_0_r0_lF":{"name":"tryMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV16tryFlatMapResult2on5token_ACyqd__s5Error_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyqd__qd_0_GAA0bF0Oyxq_GKctsAGRd_0_r0_lF":{"name":"tryFlatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/tryMapResult(on:token:_:)":{"name":"tryMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMapResult(on:token:_:)":{"name":"tryFlatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3tap2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyAA0B6ResultOyxq_GctF":{"name":"tap(on:token:_:)","abstract":"
Registers a callback that will be invoked when the promise is resolved without affecting behavior.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3tapACyxq_GyF":{"name":"tap()","abstract":"Returns a new Promise
that adopts the result of the receiver without affecting its behavior.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8onCancel0C05token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyyctF":{"name":"onCancel(on:token:_:)","abstract":"Registers a callback that will be invoked when the promise is cancelled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV23propagatingCancellation2on15cancelRequestedACyxq_GAA0B7ContextO_yAGctF":{"name":"propagatingCancellation(on:cancelRequested:)","abstract":"Returns a promise that adopts the same value as the receiver, and propagates cancellation","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4forkyACyxq_GyAEKXEKF":{"name":"fork(_:)","abstract":"
Passes the Promise
to a block and then returns the Promise
for further chaining.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV13requestCancelyyF":{"name":"requestCancel()","abstract":"Requests that the Promise
should be cancelled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV25requestCancelOnInvalidateyACyxq_GAA0B17InvalidationTokenVF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Requests that the Promise
should be cancelled when the token is invalidated.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV14ignoringCancelACyxq_GyF":{"name":"ignoringCancel()","abstract":"Returns a new Promise
that adopts the value of the receiver but ignores cancel requests.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6resultACyxq_GAA0B6ResultOyxq_G_tcfc":{"name":"init(result:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on6result5afterACyxq_GAA0B7ContextO_AA0B6ResultOyxq_GSdtcfc":{"name":"init(on:result:after:)","abstract":"Returns a Promise
that resolves with the given result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV21requestCancelOnDeinityACyxq_GyXlF":{"name":"requestCancelOnDeinit(_:)","abstract":"Requests that the Promise
should be cancelled when the object deinits.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Two Promise
s compare as equal if they represent the same promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV11cancellableAA0B11CancellableVvp":{"name":"cancellable","abstract":"Returns a value that can be used to cancel this promise without holding onto the full promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9withTokenyAA0dB0Vyxq_GAA0b12InvalidationD0VF":{"name":"withToken(_:)","abstract":"Returns a new TokenPromise
that wraps the receiver.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on9fulfilled5afterACyxq_GAA0B7ContextO_xSdtcfc":{"name":"init(on:fulfilled:after:)","abstract":"Returns a Promise
that fulfills with the given value after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on8rejected5afterACyxq_GAA0B7ContextO_q_Sdtcfc":{"name":"init(on:rejected:after:)","abstract":"Returns a Promise
that rejects with the given error after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on4with5afterACyxq_GAA0B7ContextO_AA0B6ResultOyxq_GSdtcfc":{"name":"init(on:with:after:)","abstract":"Returns a Promise
that resolves with the given result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV5delay2on_ACyxq_GAA0B7ContextO_SdtF":{"name":"delay(on:_:)","abstract":"Returns a new Promise
that adopts the receiver’s result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7timeout2on5delayACyxAA0B12TimeoutErrorOyq_GGAA0B7ContextO_SdtF":{"name":"timeout(on:delay:)","abstract":"Returns a Promise
that is rejected with an error if the receiver does not resolve within","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5ErrorR_rlE6upcastACyxsAD_pGvp":{"name":"upcast","abstract":"
Returns a new promise with an error type of Swift.Error
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVA2A7NoErrorORs_rlE6upcastACyxs0D0_pGvp":{"name":"upcast","abstract":"Returns a new promise with an error type of Swift.Error
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE2on_ACyxsAD_pGAA0B7ContextO_yAC8ResolverVyxsAD_p_GKctcfc":{"name":"init(on:_:)","abstract":"Returns a new Promise
that will be resolved using the given block.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE7tryThen2on5token_ACyxsAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgyxKctF":{"name":"tryThen(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE6tryMap2on5token_ACyqd__sAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgqd__xKctlF":{"name":"tryMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMap(on:token:_:)":{"name":"tryFlatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE10tryFlatMap2on5token_ACyqd__sAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyqd__qd_0_GxKctsADRd_0_r0_lF":{"name":"tryFlatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE10tryRecover2on5token_ACyxsAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgxsAD_pKctF":{"name":"tryRecover(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5ErrorR_rlE4withACyxq_Gs6ResultOyxq_G_tcfc":{"name":"init(with:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE7timeout2on5delayACyxsAD_pGAA0B7ContextO_SdtF":{"name":"timeout(on:delay:)","abstract":"Returns a Promise
that is rejected with an error if the receiver does not resolve within","parent_name":"Promise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV8Resolvera":{"name":"Resolver","abstract":"
The type of the promise resolver. See Promise<Value,Error>.Resolver
.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV2on_ACyxq_GAA0C7ContextO_yAA0C0V8ResolverVyxq__Gctcfc":{"name":"init(on:_:)","abstract":"Returns a new DelayedPromise
that can be resolved with the given block.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV7promiseAA0C0Vyxq_Gvp":{"name":"promise","abstract":"Returns a Promise
that asynchronously contains the value of the computation.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Two DelayedPromise
s compare as equal if they would produce equal Promise
s.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html":{"name":"DelayedPromise","abstract":"DelayedPromise
is like a Promise
but it doesn’t invoke its callback until the .promise
"},"Structs/Promise.html":{"name":"Promise","abstract":"
A Promise
is a construct that will eventually hold a value or error, and can invoke callbacks"},"Structs/PromiseCancellable.html":{"name":"PromiseCancellable","abstract":"
A type that can be used to cancel a promise without holding onto the full promise.
"},"Structs/PromiseInvalidationToken.html":{"name":"PromiseInvalidationToken","abstract":"An invalidation token that can be used to cancel callbacks registered to a Promise
.
"},"Structs/TokenPromise.html":{"name":"TokenPromise","abstract":"A Promise
adapter that automatically applies a PromiseInvalidationToken
.
"},"Functions.html#/s:12Tomorrowland4when9fulfilled3qos15cancelOnFailureAA7PromiseVySayxGq_GSayAGyxq_GG_8Dispatch0I3QoSV0J6SClassOSbtr0_lF":{"name":"when(fulfilled:qos:cancelOnFailure:)","abstract":"Waits on an array of Promise
s and returns a Promise
that is fulfilled with an array of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled_____3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_q2_q3_tq4_GAGyxq4_G_AGyq_q4_GAGyq0_q4_GAGyq1_q4_GAGyq2_q4_GAGyq3_q4_G8Dispatch0I3QoSV0J6SClassOSbtr5_lF":{"name":"when(fulfilled:_:_:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled____3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_q2_tq3_GAGyxq3_G_AGyq_q3_GAGyq0_q3_GAGyq1_q3_GAGyq2_q3_G8Dispatch0I3QoSV0J6SClassOSbtr4_lF":{"name":"when(fulfilled:_:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled___3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_tq2_GAGyxq2_G_AGyq_q2_GAGyq0_q2_GAGyq1_q2_G8Dispatch0I3QoSV0J6SClassOSbtr3_lF":{"name":"when(fulfilled:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled__3qos15cancelOnFailureAA7PromiseVyx_q_q0_tq1_GAGyxq1_G_AGyq_q1_GAGyq0_q1_G8Dispatch0I3QoSV0J6SClassOSbtr2_lF":{"name":"when(fulfilled:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled_3qos15cancelOnFailureAA7PromiseVyx_q_tq0_GAGyxq0_G_AGyq_q0_G8Dispatch0I3QoSV0J6SClassOSbtr1_lF":{"name":"when(fulfilled:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when5first15cancelRemainingAA7PromiseVyxq_GSayAGG_Sbtr0_lF":{"name":"when(first:cancelRemaining:)","abstract":"
Returns a Promise
that is resolved with the result of the first resolved input Promise
.
"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorO8timedOutyACyxGAEmlF":{"name":"timedOut","abstract":"The promise did not resolve within the given interval.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorO8rejectedyACyxGxcAEmlF":{"name":"rejected(_:)","abstract":"The promise was rejected with an error.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:10Foundation13CustomNSErrorP13errorUserInfoSDySSypGvp":{"name":"errorUserInfo","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorOAASQRzlE2eeoiySbACyxG_AEtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorOAASQRzlE2neoiySbACyxG_AEtFZ":{"name":"!=(_:_:)","abstract":"Returns a Boolean value indicating whether two values are not equal.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseTimeoutError"},"Enums/NoError.html#/s:12Tomorrowland7NoErrorO2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"NoError"},"Enums/NoError.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"NoError"},"Enums/NoError.html#/s:Se4fromxs7Decoder_p_tKcfc":{"name":"init(from:)","parent_name":"NoError"},"Enums/NoError.html#/s:SE6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","parent_name":"NoError"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5valueyACyxq_GxcAEmr0_lF":{"name":"value(_:)","abstract":"The value the promise was fulfilled with.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5erroryACyxq_Gq_cAEmr0_lF":{"name":"error(_:)","abstract":"The error the promise was rejected with.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO9cancelledyACyxq_GAEmr0_lF":{"name":"cancelled","abstract":"The promise was cancelled.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5valuexSgvp":{"name":"value","abstract":"Returns the contained value if the result is .value
, otherwise nil
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5errorq_Sgvp":{"name":"error","abstract":"Returns the contained error if the result is .error
, otherwise nil
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO11isCancelledSbvp":{"name":"isCancelled","abstract":"Returns true
if the result is .cancelled
, otherwise false
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO3mapyACyqd__q_Gqd__xKXEKlF":{"name":"map(_:)","abstract":"Maps a successful result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO8mapErroryACyxqd__Gqd__q_KXEKlF":{"name":"mapError(_:)","abstract":"Maps a rejected result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO7flatMapyACyqd__q_GAExKXEKlF":{"name":"flatMap(_:)","abstract":"Maps a successful result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO12flatMapErroryACyxqd__GAEq_KXEKlF":{"name":"flatMapError(_:)","abstract":"Maps a rejected result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAASQRzSQR_rlE2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAASQRzSQR_rlE2neoiySbACyxq_G_AEtFZ":{"name":"!=(_:_:)","abstract":"Returns a Boolean value indicating whether two values are not equal.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:SE6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:Se4fromxs7Decoder_p_tKcfc":{"name":"init(from:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAAs5ErrorR_rlEyACyxq_Gs0C0Oyxq_Gcfc":{"name":"init(_:)","abstract":"Returns a PromiseResult
from a Result
.
","parent_name":"PromiseResult"},"Enums/PromiseCallbackError.html#/c:@M@Tomorrowland@E@TWLPromiseCallbackError@TWLPromiseCallbackErrorAPIMismatch":{"name":"apiMismatch","abstract":"The callback did not conform to the expected API.
","parent_name":"PromiseCallbackError"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO4mainyA2CmF":{"name":"main","abstract":"Execute on the main queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO10backgroundyA2CmF":{"name":"background","abstract":"Execute on a dispatch queue with the .background
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO7utilityyA2CmF":{"name":"utility","abstract":"Execute on a dispatch queue with the .utility
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO7defaultyA2CmF":{"name":"default","abstract":"Execute on a dispatch queue with the .default
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO13userInitiatedyA2CmF":{"name":"userInitiated","abstract":"Execute on a dispatch queue with the .userInitiated
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO15userInteractiveyA2CmF":{"name":"userInteractive","abstract":"Execute on a dispatch queue with the .userInteractive
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO5queueyACSo012OS_dispatch_D0CcACmF":{"name":"queue(_:)","abstract":"Execute on the specified dispatch queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO14operationQueueyACSo011NSOperationE0CcACmF":{"name":"operationQueue(_:)","abstract":"Execute on the specified operation queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO9immediateyA2CmF":{"name":"immediate","abstract":"Execute synchronously.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO5nowOryA2CcACmF":{"name":"nowOr(_:)","abstract":"Execute synchronously if the promise is already resolved, otherwise use another context.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO4autoACvpZ":{"name":"auto","abstract":"Returns .main
when accessed from the main thread, otherwise .default
.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO14isExecutingNowSbvpZ":{"name":"isExecutingNow","abstract":"Returns whether a .nowOr(_:)
context is executing synchronously.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO3qosAC8Dispatch0E3QoSV0F6SClassO_tcfc":{"name":"init(qos:)","abstract":"Returns the PromiseContext
that corresponds to a given Dispatch QoS class.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html":{"name":"PromiseContext","abstract":"The context in which a Promise body or callback is evaluated.
"},"Enums/PromiseCallbackError.html":{"name":"PromiseCallbackError","abstract":"An error potentially returned from Promise.Resolver.handleCallback(isCancelError:)
.
"},"Enums/PromiseResult.html":{"name":"PromiseResult","abstract":"The result of a resolved promise.
"},"Enums/NoError.html":{"name":"NoError","abstract":"NoError
is a type that cannot be constructed.
"},"Enums/PromiseTimeoutError.html":{"name":"PromiseTimeoutError","abstract":"The error type returned from Promise.timeout
.
"},"Enums.html":{"name":"Enumerations","abstract":"The following enumerations are available globally.
"},"Functions.html":{"name":"Functions","abstract":"The following functions are available globally.
"},"Structs.html":{"name":"Structures","abstract":"The following structures are available globally.
"},"Typealiases.html":{"name":"Type Aliases","abstract":"The following type aliases are available globally.
"}}
\ No newline at end of file
+{"Typealiases.html#/s:12Tomorrowland17StdDelayedPromisea":{"name":"StdDelayedPromise","abstract":"StdDelayedPromise
is an alias for a DelayedPromise
whose error type is Swift.Error
.
"},"Typealiases.html#/s:12Tomorrowland10StdPromisea":{"name":"StdPromise","abstract":"StdPromise
is an alias for a Promise
whose error type is Swift.Error
.
"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5innerAA0C0Vyxq_Gvp":{"name":"inner","abstract":"The wrapped Promise
.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5tokenAA0c12InvalidationB0Vvp":{"name":"token","abstract":"The PromiseInvalidationToken
to use when invoking methods on the wrapped Promise
.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7promise5tokenACyxq_GAA0C0Vyxq_G_AA0c12InvalidationB0Vtcfc":{"name":"init(promise:token:)","abstract":"Returns a new TokenPromise
that wraps the given promise.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV4then2on_ACyxq_GAA0C7ContextO_yxctF":{"name":"then(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3map2on_ACyqd__q_GAA0C7ContextO_qd__xctlF":{"name":"map(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7flatMap2on_ACyqd__q_GAA0C7ContextO_AA0C0Vyqd__q_GxctlF":{"name":"flatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV5catch2on_ACyxq_GAA0C7ContextO_yq_ctF":{"name":"catch(on:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV7recover2on_ACyxAA7NoErrorOGAA0C7ContextO_xq_ctF":{"name":"recover(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV8mapError2on_ACyxqd__GAA0C7ContextO_qd__q_ctlF":{"name":"mapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV12flatMapError2on_ACyxqd__GAA0C7ContextO_AA0C0Vyxqd__Gq_ctlF":{"name":"flatMapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV11tryMapError2on_ACyxs0F0_pGAA0C7ContextO_qd__q_KctsAFRd__lF":{"name":"tryMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV15tryFlatMapError2on_ACyxs0G0_pGAA0C7ContextO_AA0C0Vyxqd__Gq_KctsAFRd__lF":{"name":"tryFlatMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryMapError(on:_:)":{"name":"tryMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMapError(on:_:)":{"name":"tryFlatMapError(on:_:)","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV6always2on_ACyxq_GAA0C7ContextO_yAA0C6ResultOyxq_GctF":{"name":"always(on:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV9mapResult2on0F8CompleteACyqd__qd_0_GAA0C7ContextO_AA0cE0Oyqd__qd_0_GAKyxq_Gctr0_lF":{"name":"mapResult(on:onComplete:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV13flatMapResult2on_ACyqd__qd_0_GAA0C7ContextO_AA0C0Vyqd__qd_0_GAA0cF0Oyxq_Gctr0_lF":{"name":"flatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV12tryMapResult2on_ACyqd__s5Error_pGAA0C7ContextO_AA0cF0Oyqd__qd_0_GAKyxq_GKctsAFRd_0_r0_lF":{"name":"tryMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV16tryFlatMapResult2on_ACyqd__s5Error_pGAA0C7ContextO_AA0C0Vyqd__qd_0_GAA0cG0Oyxq_GKctsAFRd_0_r0_lF":{"name":"tryFlatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryMapResult(on:_:)":{"name":"tryMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMapResult(on:_:)":{"name":"tryFlatMapResult(on:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3tap2on_ACyxq_GAA0C7ContextO_yAA0C6ResultOyxq_GctF":{"name":"tap(on:_:)","abstract":"
Registers a callback that will be invoked when the promise is resolved without affecting behavior.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV3tapACyxq_GyF":{"name":"tap()","abstract":"Returns a new TokenPromise
that adopts the result of the receiver without affecting its","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV8onCancel0D0_ACyxq_GAA0C7ContextO_yyctF":{"name":"onCancel(on:_:)","abstract":"
Registers a callback that will be invoked when the promise is cancelled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV4forkyACyxq_GyAEKXEKF":{"name":"fork(_:)","abstract":"Passes the TokenPromise
to a block and then returns the TokenPromise
for further","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV14ignoringCancelACyxq_GyF":{"name":"ignoringCancel()","abstract":"
Returns a new TokenPromise
that adopts the value of the receiver but ignores cancel","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"
Two TokenPromise
s compare as equal if they represent the same promise.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE7tryThen2on_ACyxsAD_pGAA0C7ContextO_yxKctF":{"name":"tryThen(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE6tryMap2on_ACyqd__sAD_pGAA0C7ContextO_qd__xKctlF":{"name":"tryMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/tryFlatMap(on:_:)":{"name":"tryFlatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE10tryFlatMap2on_ACyqd__sAD_pGAA0C7ContextO_AA0C0Vyqd__qd_0_GxKctsADRd_0_r0_lF":{"name":"tryFlatMap(on:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE10tryRecover2on_ACyxsAD_pGAA0C7ContextO_xsAD_pKctF":{"name":"tryRecover(on:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"TokenPromise"},"Structs/TokenPromise.html#/s:12Tomorrowland12TokenPromiseVAAs5Error_pRs_rlE010tryFlatMapD02on_ACyxsAD_pGAA0C7ContextO_AA0C0Vyxqd__GsAD_pKctsADRd__lF":{"name":"tryFlatMapError(on:_:)","abstract":"","parent_name":"TokenPromise"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV18invalidateOnDeinitACSb_tcfc":{"name":"init(invalidateOnDeinit:)","abstract":"Creates and returns a new PromiseInvalidationToken
.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV10invalidateyyF":{"name":"invalidate()","abstract":"Invalidates the token and cancels any associated promises.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25cancelWithoutInvalidatingyyF":{"name":"cancelWithoutInvalidating()","abstract":"Cancels any associated promises without invalidating the token.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25requestCancelOnInvalidateyyAA0B0Vyxq_Gr0_lF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Registers a Promise
to be requested to cancel automatically when the token is invalidated.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV25requestCancelOnInvalidateyySo10TWLPromiseCyxq_GRlzCRl_Cr0_lF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Registers an ObjCPromise
to be requested to cancel automatically when the token is","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV05chainC04from34includingCancelWithoutInvalidatingyAC_SbtF":{"name":"chainInvalidation(from:includingCancelWithoutInvalidating:)","abstract":"
Invalidates the token whenever another token is invalidated.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:s28CustomDebugStringConvertibleP16debugDescriptionSSvp":{"name":"debugDescription","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:12Tomorrowland24PromiseInvalidationTokenV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseInvalidationToken"},"Structs/PromiseInvalidationToken.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseInvalidationToken"},"Structs/PromiseCancellable.html#/s:12Tomorrowland18PromiseCancellableV13requestCancelyyF":{"name":"requestCancel()","abstract":"Requests cancellation of the promise this PromiseCancellable
was created from.
","parent_name":"PromiseCancellable"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7fulfill4withyx_tF":{"name":"fulfill(with:)","abstract":"Fulfills the promise with the given value.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV6reject4withyq__tF":{"name":"reject(with:)","abstract":"Rejects the promise with the given error.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV6cancelyyF":{"name":"cancel()","abstract":"Cancels the promise.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7resolve4withyAA0B6ResultOyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV7resolve4withyACyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with another promise.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV15onRequestCancel0D0_yAA0B7ContextO_yAEyxq__GctF":{"name":"onRequestCancel(on:_:)","abstract":"Registers a block that will be invoked if requestCancel()
is invoked on the promise","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverV18hasRequestedCancelSbvp":{"name":"hasRequestedCancel","abstract":"
Returns whether the promise has already been requested to cancel.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5Error_pRs_rlE7resolve4withyAA0B6ResultOyxqd__G_tsAFRd__lF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5Error_pRs_rlE14handleCallback08isCancelD0yxSg_sAF_pSgtcSbsAF_pc_tF":{"name":"handleCallback(isCancelError:)","abstract":"Convenience method for handling framework callbacks.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html#/s:12Tomorrowland7PromiseV8ResolverVAAs5ErrorR_rlE7resolve4withys6ResultOyxq_G_tF":{"name":"resolve(with:)","abstract":"Resolves the promise with the given result.
","parent_name":"Resolver"},"Structs/Promise/Resolver.html":{"name":"Resolver","abstract":"A Resolver
is used to fulfill, reject, or cancel its associated Promise
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6resultAA0B6ResultOyxq_GSgvp":{"name":"result","abstract":"Returns the result of the promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV16makeWithResolverACyxq_G_AC0E0Vyxq__GtyFZ":{"name":"makeWithResolver()","abstract":"Returns a Promise
and a Promise.Resolver
that can be used to fulfill that promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on_ACyxq_GAA0B7ContextO_yAC8ResolverVyxq__Gctcfc":{"name":"init(on:_:)","abstract":"Returns a new Promise
that will be resolved using the given block.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9fulfilledACyxq_Gx_tcfc":{"name":"init(fulfilled:)","abstract":"Returns a Promise
that is already fulfilled with the given value.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8rejectedACyxq_Gq__tcfc":{"name":"init(rejected:)","abstract":"Returns a Promise
that is already rejected with the given error.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4withACyxq_GAA0B6ResultOyxq_G_tcfc":{"name":"init(with:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4then2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyxctF":{"name":"then(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3map2on5token_ACyqd__q_GAA0B7ContextO_AA0B17InvalidationTokenVSgqd__xctlF":{"name":"map(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7flatMap2on5token_ACyqd__q_GAA0B7ContextO_AA0B17InvalidationTokenVSgAGxctlF":{"name":"flatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV5catch2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyq_ctF":{"name":"catch(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7recover2on5token_ACyxAA7NoErrorOGAA0B7ContextO_AA0B17InvalidationTokenVSgxq_ctF":{"name":"recover(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8mapError2on5token_ACyxqd__GAA0B7ContextO_AA0B17InvalidationTokenVSgqd__q_ctlF":{"name":"mapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV12flatMapError2on5token_ACyxqd__GAA0B7ContextO_AA0B17InvalidationTokenVSgAGq_ctlF":{"name":"flatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV11tryMapError2on5token_ACyxs0E0_pGAA0B7ContextO_AA0B17InvalidationTokenVSgqd__q_KctsAGRd__lF":{"name":"tryMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV15tryFlatMapError2on5token_ACyxs0F0_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyxqd__Gq_KctsAGRd__lF":{"name":"tryFlatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/tryMapError(on:token:_:)":{"name":"tryMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMapError(on:token:_:)":{"name":"tryFlatMapError(on:token:_:)","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6always2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyAA0B6ResultOyxq_GctF":{"name":"always(on:token:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9mapResult2on5token_ACyqd__qd_0_GAA0B7ContextO_AA0B17InvalidationTokenVSgAA0bD0Oyqd__qd_0_GANyxq_Gctr0_lF":{"name":"mapResult(on:token:_:)","abstract":"Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV13flatMapResult2on5token_ACyqd__qd_0_GAA0B7ContextO_AA0B17InvalidationTokenVSgAgA0bE0Oyxq_Gctr0_lF":{"name":"flatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV12tryMapResult2on5token_ACyqd__s5Error_pGAA0B7ContextO_AA0B17InvalidationTokenVSgAA0bE0Oyqd__qd_0_GAOyxq_GKctsAGRd_0_r0_lF":{"name":"tryMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV16tryFlatMapResult2on5token_ACyqd__s5Error_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyqd__qd_0_GAA0bF0Oyxq_GKctsAGRd_0_r0_lF":{"name":"tryFlatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/tryMapResult(on:token:_:)":{"name":"tryMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMapResult(on:token:_:)":{"name":"tryFlatMapResult(on:token:_:)","abstract":"
Registers a callback that will be invoked with the promise result, no matter what it is, and","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3tap2on5token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyAA0B6ResultOyxq_GctF":{"name":"tap(on:token:_:)","abstract":"
Registers a callback that will be invoked when the promise is resolved without affecting behavior.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV3tapACyxq_GyF":{"name":"tap()","abstract":"Returns a new Promise
that adopts the result of the receiver without affecting its behavior.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV8onCancel0C05token_ACyxq_GAA0B7ContextO_AA0B17InvalidationTokenVSgyyctF":{"name":"onCancel(on:token:_:)","abstract":"Registers a callback that will be invoked when the promise is cancelled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV23propagatingCancellation2on15cancelRequestedACyxq_GAA0B7ContextO_yAGctF":{"name":"propagatingCancellation(on:cancelRequested:)","abstract":"Returns a promise that adopts the same value as the receiver, and propagates cancellation","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9makeChildACyxq_GyF":{"name":"makeChild()","abstract":"
Returns a promise that adopts the same value as the receiver.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV4forkyACyxq_GyAEKXEKF":{"name":"fork(_:)","abstract":"Passes the Promise
to a block and then returns the Promise
for further chaining.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV13requestCancelyyF":{"name":"requestCancel()","abstract":"Requests that the Promise
should be cancelled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV25requestCancelOnInvalidateyACyxq_GAA0B17InvalidationTokenVF":{"name":"requestCancelOnInvalidate(_:)","abstract":"Requests that the Promise
should be cancelled when the token is invalidated.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV14ignoringCancelACyxq_GyF":{"name":"ignoringCancel()","abstract":"Returns a new Promise
that adopts the value of the receiver but ignores cancel requests.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV6resultACyxq_GAA0B6ResultOyxq_G_tcfc":{"name":"init(result:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on6result5afterACyxq_GAA0B7ContextO_AA0B6ResultOyxq_GSdtcfc":{"name":"init(on:result:after:)","abstract":"Returns a Promise
that resolves with the given result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV21requestCancelOnDeinityACyxq_GyXlF":{"name":"requestCancelOnDeinit(_:)","abstract":"Requests that the Promise
should be cancelled when the object deinits.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Two Promise
s compare as equal if they represent the same promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV11cancellableAA0B11CancellableVvp":{"name":"cancellable","abstract":"Returns a value that can be used to cancel this promise without holding onto the full promise.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV9withTokenyAA0dB0Vyxq_GAA0b12InvalidationD0VF":{"name":"withToken(_:)","abstract":"Returns a new TokenPromise
that wraps the receiver.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on9fulfilled5afterACyxq_GAA0B7ContextO_xSdtcfc":{"name":"init(on:fulfilled:after:)","abstract":"Returns a Promise
that fulfills with the given value after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on8rejected5afterACyxq_GAA0B7ContextO_q_Sdtcfc":{"name":"init(on:rejected:after:)","abstract":"Returns a Promise
that rejects with the given error after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV2on4with5afterACyxq_GAA0B7ContextO_AA0B6ResultOyxq_GSdtcfc":{"name":"init(on:with:after:)","abstract":"Returns a Promise
that resolves with the given result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV5delay2on_ACyxq_GAA0B7ContextO_SdtF":{"name":"delay(on:_:)","abstract":"Returns a new Promise
that adopts the receiver’s result after a delay.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseV7timeout2on5delayACyxAA0B12TimeoutErrorOyq_GGAA0B7ContextO_SdtF":{"name":"timeout(on:delay:)","abstract":"Returns a Promise
that is rejected with an error if the receiver does not resolve within","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5ErrorR_rlE6upcastACyxsAD_pGvp":{"name":"upcast","abstract":"
Returns a new promise with an error type of Swift.Error
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVA2A7NoErrorORs_rlE6upcastACyxs0D0_pGvp":{"name":"upcast","abstract":"Returns a new promise with an error type of Swift.Error
.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE2on_ACyxsAD_pGAA0B7ContextO_yAC8ResolverVyxsAD_p_GKctcfc":{"name":"init(on:_:)","abstract":"Returns a new Promise
that will be resolved using the given block.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE7tryThen2on5token_ACyxsAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgyxKctF":{"name":"tryThen(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE6tryMap2on5token_ACyqd__sAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgqd__xKctlF":{"name":"tryMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/tryFlatMap(on:token:_:)":{"name":"tryFlatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE10tryFlatMap2on5token_ACyqd__sAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgACyqd__qd_0_GxKctsADRd_0_r0_lF":{"name":"tryFlatMap(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is fulfilled.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE10tryRecover2on5token_ACyxsAD_pGAA0B7ContextO_AA0B17InvalidationTokenVSgxsAD_pKctF":{"name":"tryRecover(on:token:_:)","abstract":"Registers a callback that is invoked when the promise is rejected.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5ErrorR_rlE4withACyxq_Gs6ResultOyxq_G_tcfc":{"name":"init(with:)","abstract":"Returns a Promise
that is already resolved with the given result.
","parent_name":"Promise"},"Structs/Promise.html#/s:12Tomorrowland7PromiseVAAs5Error_pRs_rlE7timeout2on5delayACyxsAD_pGAA0B7ContextO_SdtF":{"name":"timeout(on:delay:)","abstract":"Returns a Promise
that is rejected with an error if the receiver does not resolve within","parent_name":"Promise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV8Resolvera":{"name":"Resolver","abstract":"
The type of the promise resolver. See Promise<Value,Error>.Resolver
.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV2on_ACyxq_GAA0C7ContextO_yAA0C0V8ResolverVyxq__Gctcfc":{"name":"init(on:_:)","abstract":"Returns a new DelayedPromise
that can be resolved with the given block.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV7promiseAA0C0Vyxq_Gvp":{"name":"promise","abstract":"Returns a Promise
that asynchronously contains the value of the computation.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html#/s:12Tomorrowland14DelayedPromiseV2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Two DelayedPromise
s compare as equal if they would produce equal Promise
s.
","parent_name":"DelayedPromise"},"Structs/DelayedPromise.html":{"name":"DelayedPromise","abstract":"DelayedPromise
is like a Promise
but it doesn’t invoke its callback until the .promise
"},"Structs/Promise.html":{"name":"Promise","abstract":"
A Promise
is a construct that will eventually hold a value or error, and can invoke callbacks"},"Structs/PromiseCancellable.html":{"name":"PromiseCancellable","abstract":"
A type that can be used to cancel a promise without holding onto the full promise.
"},"Structs/PromiseInvalidationToken.html":{"name":"PromiseInvalidationToken","abstract":"An invalidation token that can be used to cancel callbacks registered to a Promise
.
"},"Structs/TokenPromise.html":{"name":"TokenPromise","abstract":"A Promise
adapter that automatically applies a PromiseInvalidationToken
.
"},"Functions.html#/s:12Tomorrowland4when9fulfilled3qos15cancelOnFailureAA7PromiseVySayxGq_GSayAGyxq_GG_8Dispatch0I3QoSV0J6SClassOSbtr0_lF":{"name":"when(fulfilled:qos:cancelOnFailure:)","abstract":"Waits on an array of Promise
s and returns a Promise
that is fulfilled with an array of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled_____3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_q2_q3_tq4_GAGyxq4_G_AGyq_q4_GAGyq0_q4_GAGyq1_q4_GAGyq2_q4_GAGyq3_q4_G8Dispatch0I3QoSV0J6SClassOSbtr5_lF":{"name":"when(fulfilled:_:_:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled____3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_q2_tq3_GAGyxq3_G_AGyq_q3_GAGyq0_q3_GAGyq1_q3_GAGyq2_q3_G8Dispatch0I3QoSV0J6SClassOSbtr4_lF":{"name":"when(fulfilled:_:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled___3qos15cancelOnFailureAA7PromiseVyx_q_q0_q1_tq2_GAGyxq2_G_AGyq_q2_GAGyq0_q2_GAGyq1_q2_G8Dispatch0I3QoSV0J6SClassOSbtr3_lF":{"name":"when(fulfilled:_:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled__3qos15cancelOnFailureAA7PromiseVyx_q_q0_tq1_GAGyxq1_G_AGyq_q1_GAGyq0_q1_G8Dispatch0I3QoSV0J6SClassOSbtr2_lF":{"name":"when(fulfilled:_:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when9fulfilled_3qos15cancelOnFailureAA7PromiseVyx_q_tq0_GAGyxq0_G_AGyq_q0_G8Dispatch0I3QoSV0J6SClassOSbtr1_lF":{"name":"when(fulfilled:_:qos:cancelOnFailure:)","abstract":"
Waits on a tuple of Promise
s and returns a Promise
that is fulfilled with a tuple of the"},"Functions.html#/s:12Tomorrowland4when5first15cancelRemainingAA7PromiseVyxq_GSayAGG_Sbtr0_lF":{"name":"when(first:cancelRemaining:)","abstract":"
Returns a Promise
that is resolved with the result of the first resolved input Promise
.
"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorO8timedOutyACyxGAEmlF":{"name":"timedOut","abstract":"The promise did not resolve within the given interval.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorO8rejectedyACyxGxcAEmlF":{"name":"rejected(_:)","abstract":"The promise was rejected with an error.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:10Foundation13CustomNSErrorP13errorUserInfoSDySSypGvp":{"name":"errorUserInfo","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorOAASQRzlE2eeoiySbACyxG_AEtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:12Tomorrowland19PromiseTimeoutErrorOAASQRzlE2neoiySbACyxG_AEtFZ":{"name":"!=(_:_:)","abstract":"Returns a Boolean value indicating whether two values are not equal.
","parent_name":"PromiseTimeoutError"},"Enums/PromiseTimeoutError.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseTimeoutError"},"Enums/NoError.html#/s:12Tomorrowland7NoErrorO2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"NoError"},"Enums/NoError.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"NoError"},"Enums/NoError.html#/s:Se4fromxs7Decoder_p_tKcfc":{"name":"init(from:)","parent_name":"NoError"},"Enums/NoError.html#/s:SE6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","parent_name":"NoError"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5valueyACyxq_GxcAEmr0_lF":{"name":"value(_:)","abstract":"The value the promise was fulfilled with.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5erroryACyxq_Gq_cAEmr0_lF":{"name":"error(_:)","abstract":"The error the promise was rejected with.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO9cancelledyACyxq_GAEmr0_lF":{"name":"cancelled","abstract":"The promise was cancelled.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5valuexSgvp":{"name":"value","abstract":"Returns the contained value if the result is .value
, otherwise nil
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO5errorq_Sgvp":{"name":"error","abstract":"Returns the contained error if the result is .error
, otherwise nil
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO11isCancelledSbvp":{"name":"isCancelled","abstract":"Returns true
if the result is .cancelled
, otherwise false
.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO3mapyACyqd__q_Gqd__xKXEKlF":{"name":"map(_:)","abstract":"Maps a successful result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO8mapErroryACyxqd__Gqd__q_KXEKlF":{"name":"mapError(_:)","abstract":"Maps a rejected result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO7flatMapyACyqd__q_GAExKXEKlF":{"name":"flatMap(_:)","abstract":"Maps a successful result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultO12flatMapErroryACyxqd__GAEq_KXEKlF":{"name":"flatMapError(_:)","abstract":"Maps a rejected result through a block and returns the new result.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAASQRzSQR_rlE2eeoiySbACyxq_G_AEtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAASQRzSQR_rlE2neoiySbACyxq_G_AEtFZ":{"name":"!=(_:_:)","abstract":"Returns a Boolean value indicating whether two values are not equal.
","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:SE6encode2toys7Encoder_p_tKF":{"name":"encode(to:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:Se4fromxs7Decoder_p_tKcfc":{"name":"init(from:)","parent_name":"PromiseResult"},"Enums/PromiseResult.html#/s:12Tomorrowland13PromiseResultOAAs5ErrorR_rlEyACyxq_Gs0C0Oyxq_Gcfc":{"name":"init(_:)","abstract":"Returns a PromiseResult
from a Result
.
","parent_name":"PromiseResult"},"Enums/PromiseCallbackError.html#/c:@M@Tomorrowland@E@TWLPromiseCallbackError@TWLPromiseCallbackErrorAPIMismatch":{"name":"apiMismatch","abstract":"The callback did not conform to the expected API.
","parent_name":"PromiseCallbackError"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO4mainyA2CmF":{"name":"main","abstract":"Execute on the main queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO10backgroundyA2CmF":{"name":"background","abstract":"Execute on a dispatch queue with the .background
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO7utilityyA2CmF":{"name":"utility","abstract":"Execute on a dispatch queue with the .utility
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO7defaultyA2CmF":{"name":"default","abstract":"Execute on a dispatch queue with the .default
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO13userInitiatedyA2CmF":{"name":"userInitiated","abstract":"Execute on a dispatch queue with the .userInitiated
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO15userInteractiveyA2CmF":{"name":"userInteractive","abstract":"Execute on a dispatch queue with the .userInteractive
QoS.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO5queueyACSo012OS_dispatch_D0CcACmF":{"name":"queue(_:)","abstract":"Execute on the specified dispatch queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO14operationQueueyACSo011NSOperationE0CcACmF":{"name":"operationQueue(_:)","abstract":"Execute on the specified operation queue.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO9immediateyA2CmF":{"name":"immediate","abstract":"Execute synchronously.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO5nowOryA2CcACmF":{"name":"nowOr(_:)","abstract":"Execute synchronously if the promise is already resolved, otherwise use another context.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO4autoACvpZ":{"name":"auto","abstract":"Returns .main
when accessed from the main thread, otherwise .default
.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO14isExecutingNowSbvpZ":{"name":"isExecutingNow","abstract":"Returns whether a .nowOr(_:)
context is executing synchronously.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO3qosAC8Dispatch0E3QoSV0F6SClassO_tcfc":{"name":"init(qos:)","abstract":"Returns the PromiseContext
that corresponds to a given Dispatch QoS class.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html#/s:12Tomorrowland14PromiseContextO2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"Returns a Boolean value indicating whether two values are equal.
","parent_name":"PromiseContext"},"Enums/PromiseContext.html":{"name":"PromiseContext","abstract":"The context in which a Promise body or callback is evaluated.
"},"Enums/PromiseCallbackError.html":{"name":"PromiseCallbackError","abstract":"An error potentially returned from Promise.Resolver.handleCallback(isCancelError:)
.
"},"Enums/PromiseResult.html":{"name":"PromiseResult","abstract":"The result of a resolved promise.
"},"Enums/NoError.html":{"name":"NoError","abstract":"NoError
is a type that cannot be constructed.
"},"Enums/PromiseTimeoutError.html":{"name":"PromiseTimeoutError","abstract":"The error type returned from Promise.timeout
.
"},"Enums.html":{"name":"Enumerations","abstract":"The following enumerations are available globally.
"},"Functions.html":{"name":"Functions","abstract":"The following functions are available globally.
"},"Structs.html":{"name":"Structures","abstract":"The following structures are available globally.
"},"Typealiases.html":{"name":"Type Aliases","abstract":"The following type aliases are available globally.
"}}
\ No newline at end of file