diff --git a/README.md b/README.md index 17f1a48..a280bc2 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,22 @@ RestClient.GetArray(api + "/posts", (err, res) => { But working with **Promises** we can improve our code, yay! 👏 ```csharp -RestClient.GetArray(api + "/posts").Then(response => { - EditorUtility.DisplayDialog ("Success", JsonHelper.ArrayToJson(response, true), "Ok"); - return RestClient.GetArray(api + "/todos"); -}).Then(response => { - EditorUtility.DisplayDialog ("Success", JsonHelper.ArrayToJson(response, true), "Ok"); - return RestClient.GetArray(api + "/users"); -}).Then(response => { - EditorUtility.DisplayDialog ("Success", JsonHelper.ArrayToJson(response, true), "Ok"); -}).Catch(err => EditorUtility.DisplayDialog ("Error", err.Message, "Ok")); +RestClient.GetArray(api + "/posts") + .Then(response => + { + EditorUtility.DisplayDialog ("Success", JsonHelper.ArrayToJson(response, true), "Ok"); + return RestClient.GetArray(api + "/todos"); + }) + .Then(response => + { + EditorUtility.DisplayDialog ("Success", JsonHelper.ArrayToJson(response, true), "Ok"); + return RestClient.GetArray(api + "/users"); + }) + .Then(response => { + EditorUtility.DisplayDialog ("Success", JsonHelper.ArrayToJson(response, true), "Ok"); + }) + .Catch((RequestException err) => EditorUtility.DisplayDialog ("Error", err.Message, "Ok")) + .Forget(); ``` ## Features 🎮 @@ -51,7 +58,7 @@ RestClient.GetArray(api + "/posts").Then(response => { - Automatic transforms for **JSON Arrays**. - Supports default **HTTP** Methods **(GET, POST, PUT, DELETE, HEAD, PATCH)** - Generic **REQUEST** method to create any http request -- Based on **Promises** for a better asynchronous programming. Learn about Promises [here](https://github.com/Real-Serious-Games/C-Sharp-Promise)! +- Based on **Promises** for a better asynchronous programming. Learn about Promises [here](https://github.com/timcassell/ProtoPromise)! - Utility to work during scene transition - Handle HTTP exceptions and retry requests easily - Open Source 🦄 @@ -80,7 +87,7 @@ Do you want to see this beautiful package in action? Download the demo [here](ht Download and install the **.unitypackage** file of the latest release published [here](https://github.com/proyecto26/RestClient/releases). ### UPM package -Make sure you had installed [C# Promise package](https://openupm.com/packages/com.rsg.promise/) or at least have it in your [openupm scope registry](https://openupm.com/). Then install **RestClient package** using this URL from **Package Manager**: `https://github.com/proyecto26/RestClient.git#upm` +Make sure you had installed [ProtoPromise package](https://openupm.com/packages/com.timcassell.protopromise/) or at least have it in your [openupm scope registry](https://openupm.com/). Then install **RestClient package** using this URL from **Package Manager**: `https://github.com/proyecto26/RestClient.git#upm` ### NuGet package Other option is download this package from **NuGet** with **Visual Studio** or using the **nuget-cli**, a **[NuGet.config](https://github.com/proyecto26/RestClient/blob/master/demo/NuGet.config)** file is required at the root of your **Unity Project**, for example: @@ -100,19 +107,19 @@ The default methods **(GET, POST, PUT, DELETE, HEAD)** are: ```csharp RestClient.Get("https://jsonplaceholder.typicode.com/posts/1").Then(response => { EditorUtility.DisplayDialog("Response", response.Text, "Ok"); -}); +}).Forget(); RestClient.Post("https://jsonplaceholder.typicode.com/posts", newPost).Then(response => { EditorUtility.DisplayDialog("Status", response.StatusCode.ToString(), "Ok"); -}); +}).Forget(); RestClient.Put("https://jsonplaceholder.typicode.com/posts/1", updatedPost).Then(response => { EditorUtility.DisplayDialog("Status", response.StatusCode.ToString(), "Ok"); -}); +}).Forget(); RestClient.Delete("https://jsonplaceholder.typicode.com/posts/1").Then(response => { EditorUtility.DisplayDialog("Status", response.StatusCode.ToString(), "Ok"); -}); +}).Forget(); RestClient.Head("https://jsonplaceholder.typicode.com/posts").Then(response => { EditorUtility.DisplayDialog("Status", response.StatusCode.ToString(), "Ok"); -}); +}).Forget(); ``` ## Handling during scene transition @@ -164,10 +171,10 @@ RestClient.Request(new RequestHelper { AssetBundle assetBundle = ((DownloadHandlerAssetBundle)response.Request.downloadHandler).assetBundle; EditorUtility.DisplayDialog("Status", response.StatusCode.ToString(), "Ok"); -}).Catch(err => { +}).Catch((RequestException err) => { var error = err as RequestException; EditorUtility.DisplayDialog("Error Response", error.Response, "Ok"); -}); +}).Forget(); ``` - Example downloading an audio file: @@ -182,9 +189,9 @@ RestClient.Get(new RequestHelper { AudioSource audio = GetComponent(); audio.clip = ((DownloadHandlerAudioClip)res.Request.downloadHandler).audioClip; audio.Play(); -}).Catch(err => { +}).Catch((RequestException err) => { EditorUtility.DisplayDialog ("Error", err.Message, "Ok"); -}); +}).Forget(); ``` With all the methods we have the possibility to indicate the type of response, in the following example we're going to create a class and the **HTTP** requests to load **JSON** data easily: @@ -206,13 +213,13 @@ public class User var usersRoute = "https://jsonplaceholder.typicode.com/users"; RestClient.Get(usersRoute + "/1").Then(firstUser => { EditorUtility.DisplayDialog("JSON", JsonUtility.ToJson(firstUser, true), "Ok"); -}); +}).Forget(); ``` * **GET Array (JsonHelper is an extension to manage arrays)** ```csharp RestClient.GetArray(usersRoute).Then(allUsers => { EditorUtility.DisplayDialog("JSON Array", JsonHelper.ArrayToJsonString(allUsers, true), "Ok"); -}); +}).Forget(); ``` Also we can create different classes for custom responses: @@ -227,13 +234,13 @@ public class CustomResponse ```csharp RestClient.Post(usersRoute, newUser).Then(customResponse => { EditorUtility.DisplayDialog("JSON", JsonUtility.ToJson(customResponse, true), "Ok"); -}); +}).Forget(); ``` * **PUT** ```csharp RestClient.Put(usersRoute + "/1", updatedUser).Then(customResponse => { EditorUtility.DisplayDialog("JSON", JsonUtility.ToJson(customResponse, true), "Ok"); -}); +}).Forget(); ``` ## Custom HTTP Headers, Params and Options 💥 @@ -260,7 +267,7 @@ var currentRequest = new RequestHelper { }; RestClient.GetArray(currentRequest).Then(response => { EditorUtility.DisplayDialog("Header", currentRequest.GetHeader("Authorization"), "Ok"); -}); +}).Forget(); ``` And we can know the status of the request and cancel it! @@ -305,7 +312,7 @@ RestClient.Post("www.api.com/endpoint", new User { }).Then(response => { EditorUtility.DisplayDialog("ID: ", response.id, "Ok"); EditorUtility.DisplayDialog("Date: ", response.date, "Ok"); -}); +}).Forget(); ``` - NodeJS as Backend (Using [Express](http://expressjs.com/es/starter/hello-world.html)) ```js @@ -319,6 +326,7 @@ router.post('/', function(req, res) { ``` ## Credits 👍 +* **ProtoPromise** [Robust and efficient library for management of asynchronous operations.](https://github.com/timcassell/ProtoPromise) * **C-Sharp-Promise:** [Promises library for C# for management of asynchronous operations.](https://github.com/Real-Serious-Games/C-Sharp-Promise) * **MyAPI:** [A template to create awesome APIs easily ⚡️](https://github.com/proyecto26/MyAPI) diff --git a/demo/Assets/MainScript.cs b/demo/Assets/MainScript.cs index d71ab10..4b87539 100644 --- a/demo/Assets/MainScript.cs +++ b/demo/Assets/MainScript.cs @@ -4,96 +4,120 @@ using Proyecto26; using System.Collections.Generic; -public class MainScript : MonoBehaviour { +public class MainScript : MonoBehaviour +{ + private readonly string basePath = "https://jsonplaceholder.typicode.com"; - private readonly string basePath = "https://jsonplaceholder.typicode.com"; - - private void LogMessage(string title, string message) { + private void LogMessage(string title, string message) + { #if UNITY_EDITOR - EditorUtility.DisplayDialog (title, message, "Ok"); + EditorUtility.DisplayDialog(title, message, "Ok"); #else Debug.Log(message); #endif - } - - public void Get(){ - - // We can add default request headers for all requests - RestClient.DefaultRequestHeaders["Authorization"] = "Bearer ..."; + } - RequestHelper requestOptions = null; + public void Get() + { + // We can add default request headers for all requests + RestClient.DefaultRequestHeaders["Authorization"] = "Bearer ..."; - RestClient.GetArray(basePath + "/posts").Then(res => { - this.LogMessage ("Posts", JsonHelper.ArrayToJsonString(res, true)); - return RestClient.GetArray(basePath + "/todos"); - }).Then(res => { - this.LogMessage ("Todos", JsonHelper.ArrayToJsonString(res, true)); - return RestClient.GetArray(basePath + "/users"); - }).Then(res => { - this.LogMessage ("Users", JsonHelper.ArrayToJsonString(res, true)); + RequestHelper requestOptions = null; - // We can add specific options and override default headers for a request - requestOptions = new RequestHelper { - Uri = basePath + "/photos", - EnableDebug = true, - Headers = new Dictionary { - { "Authorization", "Other token..." } - } - }; - return RestClient.GetArray(requestOptions); - }).Then(res => { - this.LogMessage("Header", requestOptions.GetHeader("Authorization")); + RestClient.GetArray(basePath + "/posts") + .Then(res => + { + this.LogMessage("Posts", JsonHelper.ArrayToJsonString(res, true)); + return RestClient.GetArray(basePath + "/todos"); + }) + .Then(res => + { + this.LogMessage("Todos", JsonHelper.ArrayToJsonString(res, true)); + return RestClient.GetArray(basePath + "/users"); + }) + .Then(res => + { + this.LogMessage("Users", JsonHelper.ArrayToJsonString(res, true)); - // And later we can clean the default headers for all requests - RestClient.ClearDefaultHeaders(); + // We can add specific options and override default headers for a request + requestOptions = new RequestHelper + { + Uri = basePath + "/photos", + EnableDebug = true, + Headers = new Dictionary { + { "Authorization", "Other token..." } + } + }; + return RestClient.GetArray(requestOptions); + }) + .Then(res => + { + this.LogMessage("Header", requestOptions.GetHeader("Authorization")); - }).Catch(err => this.LogMessage ("Error", err.Message)); - } + // And later we can clean the default headers for all requests + RestClient.ClearDefaultHeaders(); - public void Post(){ - - RestClient.Post(basePath + "/posts", new Post { - title = "My first title", - body = "My first message", - userId = 26 - }) - .Then(res => this.LogMessage ("Success", JsonUtility.ToJson(res, true))) - .Catch(err => this.LogMessage ("Error", err.Message)); - } + }) + .Catch((RequestException err) => this.LogMessage("Error", err.Message)) + .Forget(); + } - public void Put(){ + public void Post() + { + RestClient.Post(basePath + "/posts", new Post + { + title = "My first title", + body = "My first message", + userId = 26 + }) + .Then(res => this.LogMessage("Success", JsonUtility.ToJson(res, true))) + .Catch((RequestException err) => this.LogMessage("Error", err.Message)) + .Forget(); + } - RestClient.Put(new RequestHelper { - Uri = basePath + "/posts/1", - Body = new Post { - title = "My new title", - body = "My new message", - userId = 26 - }, - Retries = 5, - RetrySecondsDelay = 1, - RetryCallback = (err, retries) => { - Debug.Log(string.Format("Retry #{0} Status {1}\nError: {2}", retries, err.StatusCode, err)); - } - }, (err, res, body) => { - if(err != null){ - this.LogMessage ("Error", err.Message); - } - else{ - this.LogMessage ("Success", res.Text); - } - }); - } + public void Put() + { + RestClient.Put(new RequestHelper + { + Uri = basePath + "/posts/1", + Body = new Post + { + title = "My new title", + body = "My new message", + userId = 26 + }, + Retries = 5, + RetrySecondsDelay = 1, + RetryCallback = (err, retries) => + { + Debug.Log(string.Format("Retry #{0} Status {1}\nError: {2}", retries, err.StatusCode, err)); + } + }, (err, res, body) => + { + if (err != null) + { + this.LogMessage("Error", err.Message); + } + else + { + this.LogMessage("Success", res.Text); + } + }); + } - public void Delete(){ + public void Delete() + { - RestClient.Delete(basePath + "/posts/1", (err, res) => { - if(err != null){ - this.LogMessage ("Error", err.Message); - } - else{ - this.LogMessage ("Success", "Status: " + res.StatusCode.ToString()); - } - }); - } + RestClient.Delete(basePath + "/posts/1", (err, res) => + { + if (err != null) + { + this.LogMessage("Error", err.Message); + } + else + { + this.LogMessage("Success", "Status: " + res.StatusCode.ToString()); + } + }); + } } diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1.meta b/demo/Assets/Packages/ProtoPromise.2.5.0.meta similarity index 60% rename from demo/Assets/Packages/RSG.Promise.3.0.1.meta rename to demo/Assets/Packages/ProtoPromise.2.5.0.meta index c7afffa..ec71f3c 100644 --- a/demo/Assets/Packages/RSG.Promise.3.0.1.meta +++ b/demo/Assets/Packages/ProtoPromise.2.5.0.meta @@ -1,10 +1,9 @@ fileFormatVersion: 2 -guid: dba11895d83524b8c8fb6596ae894932 +guid: 0eb1e48782473be4d8607d9fdc15c832 folderAsset: yes -timeCreated: 1542470878 +timeCreated: 1684393107 licenseType: Free DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/lib.meta b/demo/Assets/Packages/ProtoPromise.2.5.0/lib.meta similarity index 60% rename from demo/Assets/Packages/RSG.Promise.3.0.1/lib.meta rename to demo/Assets/Packages/ProtoPromise.2.5.0/lib.meta index 291ef9b..1dd2371 100644 --- a/demo/Assets/Packages/RSG.Promise.3.0.1/lib.meta +++ b/demo/Assets/Packages/ProtoPromise.2.5.0/lib.meta @@ -1,10 +1,9 @@ fileFormatVersion: 2 -guid: 99add3d99d22e40bf980eaf56dfbc0af +guid: 045bccd7cb0f07a4a9cf21e4afd2b2b5 folderAsset: yes -timeCreated: 1542470879 +timeCreated: 1684393107 licenseType: Free DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35.meta b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35.meta similarity index 60% rename from demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35.meta rename to demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35.meta index 5ea562f..7c630c1 100644 --- a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35.meta +++ b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35.meta @@ -1,10 +1,9 @@ fileFormatVersion: 2 -guid: 740e94469b97441ce93cf884d0cc1dd0 +guid: 93cec50c67d7b0d4286f213ecb531fea folderAsset: yes -timeCreated: 1542470879 +timeCreated: 1684393107 licenseType: Free DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0.meta b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release.meta similarity index 60% rename from demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0.meta rename to demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release.meta index a68a029..0ac56fa 100644 --- a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0.meta +++ b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release.meta @@ -1,10 +1,9 @@ fileFormatVersion: 2 -guid: 85673716972994e1fa3fd691e694b47e +guid: 6e6d5ba4841d513448988d3b5b88973f folderAsset: yes -timeCreated: 1542470879 +timeCreated: 1684393108 licenseType: Free DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.dll b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.dll new file mode 100644 index 0000000..9fe4ff9 Binary files /dev/null and b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.dll differ diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0/RSG.Promise.dll.meta b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.dll.meta similarity index 90% rename from demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0/RSG.Promise.dll.meta rename to demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.dll.meta index a0dff8a..b73818d 100644 --- a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0/RSG.Promise.dll.meta +++ b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.dll.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 109b0b0ea063f4f18adf93103c01e53b -timeCreated: 1548223575 +guid: 4dc5de2c9416e6d4d897949075f280d1 +timeCreated: 1684393113 licenseType: Free PluginImporter: serializedVersion: 2 diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/RSG.Promise.3.0.1.nupkg.meta b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.pdb.meta similarity index 56% rename from demo/Assets/Packages/RSG.Promise.3.0.1/RSG.Promise.3.0.1.nupkg.meta rename to demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.pdb.meta index 4107123..dd8c32b 100644 --- a/demo/Assets/Packages/RSG.Promise.3.0.1/RSG.Promise.3.0.1.nupkg.meta +++ b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.pdb.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: 563dd256bcb7b461d9b7b846ac97cc3b -timeCreated: 1547017321 +guid: 9ebe622b46a7e4946a19a6d1d8b1073c +timeCreated: 1684393109 licenseType: Free DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.xml b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.xml new file mode 100644 index 0000000..e0004e0 --- /dev/null +++ b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.xml @@ -0,0 +1,8074 @@ + + + + ProtoPromise + + + + + Represents a callback delegate that has been registered with a . + + + + + FOR INTERNAL USE ONLY! + + + + + Get the associated with this . + + + + + Get whether the callback is registered. + + + + + Get whether the callback is registered and whether the associated is requesting cancelation as an atomic operation. + + true if this is registered, false otherwise + true if the associated is requesting cancelation, false otherwise + + + + Try to unregister the callback from the associated . Returns true if the callback was successfully unregistered, false otherwise. + + true if the callback was previously registered and the associated not yet canceled and the associated not yet disposed, false otherwise + + + + Try to unregister the callback from the associated . Returns true if the callback was successfully unregistered, false otherwise. + will be true if the associated is requesting cancelation, false otherwise. + + true if the associated is requesting cancelation, false otherwise + true if the callback was previously registered and the associated not yet canceled or disposed, false otherwise + + + + Try to unregister the callback from the associated . + If the callback is currently executing, this method will wait until it completes, + except in the degenerate case where the callback itself is unregistering itself. + + + + + Try to unregister the callback from the associated . + The returned will be resolved once the associated callback + is unregistered without having executed or once it's finished executing, except + in the degenerate case where the callback itself is unregistering itself. + + + + Returns a value indicating whether this value is equal to a specified . + + + Returns a value indicating whether this value is equal to a specified . + + + Returns the hash code for this instance. + + + Returns a value indicating whether two values are equal. + + + Returns a value indicating whether two values are not equal. + + + + Cancelation source used to cancel operations. + + + + + Create a new . + Note: the new must be disposed when you are finished with it. + + + + + Create a new that will be canceled either when you cancel it, or when the given token is canceled (with the same value), whichever is first. + Note: the new still must be disposed when you are finished with it. + + The cancelation token to observe. + A new that is linked to the source token. + + + + Create a new that will be canceled either when you cancel it, or when any of the given tokens are canceled (with the same value), whichever is first. + Note: the new still must be disposed when you are finished with it. + + The first cancelation token to observe. + The second cancelation token to observe. + A new that is linked to the source token. + + + + Create a new that will be canceled either when you cancel it, or when any of the given tokens are canceled (with the same value), whichever is first. + Note: the new still must be disposed when you are finished with it. + + An array that contains the cancelation token instances to observe. + A new that is linked to the source token. + + + + Get the associated with this . + + + + + Get whether or not this is valid. + A is valid if it was created from and was not disposed. + + + + + Gets whether cancelation has been requested for this source. + + + + + Try to communicate a request for cancelation, and invoke all callbacks that are registered to the associated . Returns true if successful, false otherwise. + + True if this is valid and was not already canceled, false otherwise. + + + + Communicate a request for cancelation, and invoke all callbacks that are registered to the associated . + + + + + + Try to release all resources used by this . This instance will no longer be valid. + + True if this is valid and was not already disposed, false otherwise. + + + + Release all resources used by this . This instance will no longer be valid. + + + + + Returns a value indicating whether this value is equal to a specified . + + + Returns a value indicating whether this value is equal to a specified . + + + Returns the hash code for this instance. + + + Returns a value indicating whether two values are equal. + + + Returns a value indicating whether two values are not equal. + + + + Propagates notification that operations should be canceled. + + + + + Returns an empty . + + + + + FOR INTERNAL USE ONLY! + + + + + Get a token that is already in the canceled state. + + + + + Gets whether this token is capable of being in the canceled state. + + + A is capable of being in the canceled state when the it is attached to has not been disposed, + or if the token is already canceled and it has been retained and not yet released. + + + + + Gets whether cancelation has been requested for this token. + + + + + If cancelation was requested on this token, throws a . + + + + + + Try to register a delegate that will be invoked when this is canceled. + If this is already canceled, the callback will be invoked immediately and this will return true. + + The delegate to be executed when the is canceled. + The instance that can be used to unregister the callback. + true if was registered successfully, false otherwise. + + + + Try to capture a value and register a delegate that will be invoked with the captured value when this is canceled. + If this is already canceled, the callback will be invoked immediately and this will return true. + + The value to pass into . + The delegate to be executed when the is canceled. + The instance that can be used to unregister the callback. + true if was registered successfully, false otherwise. + + + + Try to register a cancelable that will be canceled when this is canceled. + If this is already canceled, it will be canceled immediately and this will return true. + + The cancelable to be canceled when the is canceled. + The instance that can be used to unregister the callback. + true if was registered successfully, false otherwise. + + + + Register a delegate that will be invoked when this is canceled. + If this is already canceled, the callback will be invoked immediately. + + The delegate to be executed when the is canceled. + The instance that can be used to unregister the callback. + + + + Capture a value and register a delegate that will be invoked with the captured value when this is canceled. + If this is already canceled, the callback will be invoked immediately. + + The value to pass into . + The delegate to be executed when the is canceled. + The instance that can be used to unregister the callback. + + + + Register a cancelable that will be canceled when this is canceled. + If this is already canceled, it will be canceled immediately. + + The cancelable to be canceled when the is canceled. + The instance that can be used to unregister the callback. + + + + Try to retain this instance. Returns true if successful, false otherwise. + If successful, allows continued use of this instance, even after the associated has been disposed, until this is released. + If successful, this should be paired with a call to . + + + + + Release this instance. Allows resources to be released when the associated is disposed (if has been called for all calls). + This should always be paired with a call to . + + + + + + Gets a retainer that facilitates retaining and releasing this instance. This is intended to be used with a using block `using (token.GetRetainer()) { ... }`. + + + + Returns a value indicating whether this value is equal to a specified . + + + Returns a value indicating whether this value is equal to a specified . + + + Returns the hash code for this instance. + + + Returns a value indicating whether two values are equal. + + + Returns a value indicating whether two values are not equal. + + + + A helper type that facilitates retaining and releasing s with a using statement. + This is intended to be used instead of and to reduce boilerplate code. + + + + + Releases the token if it was retained. This instance is no longer valid after it has been disposed, and should not continue to be used. + + + + + Helpful extensions to convert promises to and from other asynchronous types. + + + + + Members of this type are meant for INTERNAL USE ONLY! Do not use in user code! Use the documented public APIs. + + + + + Doesn't actually move next, just returns if Current is valid. + This allows the function to be branch-less. Useful for foreach loops. + + + + + Actually moves next and returns current. + + + + + This structure is unsuitable for general purpose. + + + + + Use instead of Monitor.Enter(object). + Must not be readonly. + + + + + This structure is unsuitable for general purpose. + + + + + This structure is unsuitable for general purpose. + + + + + This structure is unsuitable for general purpose. + + + + Represents one or more errors that occur during application execution. + + is used to consolidate multiple failures into a single, throwable + exception object. + + + + + Initializes a new instance of the class with + references to the inner exceptions that are the cause of this exception. + + The exceptions that are the cause of the current exception. + The argument + is null. + An element of is + null. + + + + Initializes a new instance of the class with a specified error + message and references to the inner exceptions that are the cause of this exception. + + The error message that explains the reason for the exception. + The exceptions that are the cause of the current exception. + The argument + is null. + An element of is + null. + + + + Allocates a new aggregate exception with the specified message and list of inner exceptions. + + The error message that explains the reason for the exception. + The exceptions that are the cause of the current exception. + The argument + is null. + An element of is + null. + + + + Returns the that is the root cause of this exception. + + + + + Gets a read-only collection of the instances that caused the + current exception. + + + + + Invokes a handler on each contained by this . + + The predicate to execute for each exception. The predicate accepts as an + argument the to be processed and returns a Boolean to indicate + whether the exception was handled. + + Each invocation of the returns true or false to indicate whether the + was handled. After all invocations, if any exceptions went + unhandled, all unhandled exceptions will be put into a new + which will be thrown. Otherwise, the method simply returns. If any + invocations of the throws an exception, it will halt the processing + of any more exceptions and immediately propagate the thrown exception as-is. + + An exception contained by this was not handled. + The argument is + null. + + + + Flattens an instances into a single, new instance. + + A new, flattened . + + If any inner exceptions are themselves instances of + , this method will recursively flatten all of them. The + inner exceptions returned in the new + will be the union of all of the the inner exceptions from exception tree rooted at the provided + instance. + + + + + Creates and returns a string representation of the current . + + A string representation of the current exception. + + + + This helper property is used by the DebuggerDisplay. + + Note that we don't want to remove this property and change the debugger display to {InnerExceptions.Count} + because DebuggerDisplay should be a single property access or parameterless method call, so that the debugger + can use a fast path without using the expression evaluator. + + See http://msdn.microsoft.com/en-us/library/x810d419.aspx + + + + + Provides support for spin-based waiting. + + + + encapsulates common spinning logic. On single-processor machines, yields are + always used instead of busy waits, and on computers with Intel™ processors employing Hyper-Threading™ + technology, it helps to prevent hardware thread starvation. SpinWait encapsulates a good mixture of + spinning and true yielding. + + + is a value type, which means that low-level code can utilize SpinWait without + fear of unnecessary allocation overheads. SpinWait is not generally useful for ordinary applications. + In most cases, you should use the synchronization classes provided by the .NET Framework, such as + . For most purposes where spin waiting is required, however, + the type should be preferred over the method. + + + While SpinWait is designed to be used in concurrent applications, it is not designed to be + used from multiple threads concurrently. SpinWait's members are not thread-safe. If multiple + threads must spin, each should use its own instance of SpinWait. + + + + + + Gets the number of times has been called on this instance. + + + + + Gets whether the next call to will yield the processor, triggering a + forced context switch. + + Whether the next call to will yield the processor, triggering a + forced context switch. + + On a single-CPU machine, always yields the processor. On machines with + multiple CPUs, may yield after an unspecified number of calls. + + + + + Performs a single spin. + + + This is typically called in a loop, and may change in behavior based on the number of times a + has been called thus far on this instance. + + + + + Resets the spin counter. + + + This makes and behave as though no calls + to had been issued on this instance. If a instance + is reused many times, it may be useful to reset it to avoid yielding too soon. + + + + + Spins until the specified condition is satisfied. + + A delegate to be executed over and over until it returns true. + The argument is null. + + + + Spins until the specified condition is satisfied or until the specified timeout is expired. + + A delegate to be executed over and over until it returns true. + + A that represents the number of milliseconds to wait, + or a TimeSpan that represents -1 milliseconds to wait indefinitely. + True if the condition is satisfied within the timeout; otherwise, false + The argument is null. + is a negative number + other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than + . + + + + Spins until the specified condition is satisfied or until the specified timeout is expired. + + A delegate to be executed over and over until it returns true. + The number of milliseconds to wait, or (-1) to wait indefinitely. + True if the condition is satisfied within the timeout; otherwise, false + The argument is null. + is a + negative number other than -1, which represents an infinite time-out. + + + + A helper class to get the number of processors, it updates the numbers of processors every sampling interval. + + + + + Gets the number of available processors + + + + + Gets whether the current machine has only a single processor. + + + + + A helper class to capture a start time using Environment.TickCout as a time in milliseconds, also updates a given timeout bu subtracting the current time from + the start time + + + + + Returns the Environment.TickCount as a start time in milliseconds as a uint, TickCount tools over from postive to negative every ~ 25 days + then ~25 days to back to positive again, uint is sued to ignore the sign and double the range to 50 days + + + + + + Helper function to measure and update the elapsed time + + The first time (in milliseconds) observed when the wait started + The orginal wait timeoutout in milliseconds + The new wait time in milliseconds, -1 if the time expired + + + + Cancelable interface + + + + + Cancel this instance. + + + + + Retainable interface + + + + + Retain this instance. + This should always be paired with a call to + + + + + Release this instance. + This should always be paired with a call to + + + + + A represents the eventual result of an asynchronous operation. + The primary ways of interacting with a are via the `await` keyword in an async function, + or through its then method, which registers callbacks to be invoked when the is resolved, + or the reason why the cannot be resolved. + + + + Gets an awaiter for this . + This method is intended for compiler use rather than use directly in code. + The awaiter. + + + Gets an awaiter for this that suppresses throws and returns a instead. + The awaiter. + Use as `var resultContainer = await promise.AwaitNoThrow();` + + + + Gets an awaiter for this that supports reporting progress to the async or function. + The progress reported will be lerped from to . Both values must be between 0 and 1 inclusive. + + The awaiter. + Use as `await promise.AwaitWithProgress(minProgress, maxProgress);` + + + + Gets an awaiter for this that supports reporting progress to the async or function. + The progress reported will be lerped from its current progress to . must be between 0 and 1 inclusive. + + The awaiter. + + If the previously awaited promise did not complete successfully, minProgress will be set to the previous instead of current. + Use as `await promise.AwaitWithProgress(maxProgress);` + + + + + Gets an awaiter for this that supports reporting progress to the async or function, + and suppresses throws and returns a instead. + The progress reported will be lerped from to . Both values must be between 0 and 1 inclusive. + + The awaiter. + Use as `var resultContainer = await promise.AwaitWithProgressNoThrow(minProgress, maxProgress);` + + + + Gets an awaiter for this that supports reporting progress to the async or function, + and suppresses throws and returns a instead. + The progress reported will be lerped from its current progress to . must be between 0 and 1 inclusive. + + The awaiter. + + If the previously awaited promise did not complete successfully, minProgress will be set to the previous instead of current. + Use as `var resultContainer = await promise.AwaitWithProgressNoThrow(maxProgress);` + + + + + At what granularity should stack traces be captured when a promise is created or rejected. Higher values are more costly, but give more information for debugging purposes. + + + + + Don't track any causality traces. + + + + + Track causality only when Deferred.Reject is called. + + + + + Track causality when Deferred.Reject is called and every time a promise is created or a delegate is added to a promise (i.e. with .Then or .Progress). + + NOTE: This can be extremely expensive, so you should only enable this if you ran into an error and you are not sure where it came from. + + + + + Promise configuration. Configuration settings affect the global behaviour of promises. + + + + + The distance between 1 and the largest value smaller than 1. Progress reports use full 32-bit float precision. + + + + + Should objects be pooled or not. If this is enabled, objects can be reused to reduce GC pressure. + + + + + Set how causality is traced in DEBUG mode. Causality traces are readable from an UnhandledException's Stacktrace property. + + + + + Uncaught rejections get routed through this delegate. + + + This must be set to a non-null delegate, otherwise uncaught rejections will be thrown in the or . + + + + + The used to marshal work to the UI thread. + + It is recommended to set this at application startup. It is also recommended to set at the same time. + + + Promise.Config.ForegroundContext = SynchronizationContext.Current; + + + + + + The used to marshal work to a background thread. If this is null, is used. + + + + + When enabled, objects are supported in async and async methods. + + + This is disabled by default, and cannot be disabled after enabled. + + + + + Deferred base. An instance of this can be used to report progress and reject or cancel the attached . + You must use or to resolve the attached . + + + + + The attached that this controls. + + + + + Get whether or not this instance and the attached are valid. + + + + + Get whether or not this instance is valid and the attached is still pending. + + + + + Internal use for implicit cast operator. + + + + + Cast this to . Throws an if it cannot be casted. + + + + + + Cast this to . Returns an invalid if it cannot be casted. + + + + + Cast this to . Throws an if it cannot be casted. + + + + + + Cast this to . Returns an invalid if it cannot be casted. + + + + + Reject the linked with . + + + + + + Try to reject the linked with . + Returns true if successful, false otherwise. + + + + + Cancel the linked . + + + + + + Try to cancel the linked . + Returns true if successful, false otherwise. + + + + + Report progress between 0 and 1. + + + + + + + Try to report progress between 0 and 1. + Returns true if successful, false otherwise. + + + + + Returns a value indicating whether this value is equal to a specified . + + + Returns a value indicating whether this value is equal to a specified . + + + Returns the hash code for this instance. + + + Returns a value indicating whether two values are equal. + + + Returns a value indicating whether two values are not equal. + + + + An instance of this is used to report progress and resolve, reject, or cancel the attached . + + + + + The attached that this controls. + + + + + Get whether or not this instance and the attached are valid. + + + + + Get whether or not this instance is valid and the attached is still pending. + + + + + Internal use. + + + + + Returns a new instance that is linked to and controls the state of a new . + + + + + Returns a new instance that is linked to and controls the state of a new . + If the is canceled while the is pending, it and the will be canceled. + + + + + Resolve the linked . + + + + + + Try to resolve the linked . + Returns true if successful, false otherwise. + + + + + Reject the linked with . + + + + + + Try to reject the linked with . + Returns true if successful, false otherwise. + + + + + Cancel the linked . + + + + + + Try to cancel the linked . + Returns true if successful, false otherwise. + + + + + Report progress between 0 and 1. + + + + + + + Try to report progress between 0 and 1. + Returns true if successful, false otherwise. + + + + + + Cast to . + + + + + Cast to . + + + + Returns a value indicating whether this value is equal to a specified . + + + Returns a value indicating whether this value is equal to a specified . + + + Returns the hash code for this instance. + + + Returns a value indicating whether two values are equal. + + + Returns a value indicating whether two values are not equal. + + + + The state of the promise. + + + + + The promise has not yet completed. (The operation is in progress.) + + + + + The promise completed successfully. (The operation ran to completion with no errors.) + + + + + The promise failed to complete due to a reason. + + + + + The promise was canceled before the operation was able to complete. + + + + + The delegate type used for . + + The container from which the promise's state and result or reason can be extracted. + + + + The delegate type used for . + + The value that was passed to . + The container from which the promise's state and result or reason can be extracted. + + + + The delegate type used for . + + The container from which the promise's state and result or reason can be extracted. + + + + The delegate type used for . + + The value that was passed to . + The container from which the promise's state and result or reason can be extracted. + + + + Internal use. + + + + + Internal use. + + + + + Internal use. + + + + + Internal use. + + + + + Promise manager. This can be used to clear pooled objects (if enabled). + + + + + Clears all currently pooled objects. Does not affect pending or preserved promises. + + + + + The for the current thread, used internally to execute continuations synchronously if the supplied context matches this. + + It is recommended to set this at application startup, at the same as you set . + + + + Gets whether this instance is valid to be awaited. + + + + + Mark this as awaited and get a new that inherits the state of this and can be awaited multiple times until is called on it. + must be called when you are finished with it. + NOTE: You should not return a preserved from a public API. Use to get a that is publicly safe. + + + + + Mark this as awaited and prevent any further awaits or callbacks on this. + NOTE: It is imperative to terminate your promise chains with Forget so that any uncaught rejections will be reported and objects repooled (if pooling is enabled). + + + + + Mark this as awaited and wait for the operation to complete. + If the operation was rejected or canceled, the appropriate exception will be thrown. + + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + Mark this as awaited and wait for the operation to complete, without throwing. Returns a that wraps the completion state and reason. + + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + Mark this as awaited and wait for the operation to complete with a specified timeout. + This will return if the operation completed successfully before the timeout expired, otherwise. + If the operation was rejected or canceled, the appropriate exception will be thrown. + + + If a representing -1 millisecond is specified for the timeout parameter, this method blocks indefinitely until the operation is complete. + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + + Mark this as awaited and wait for the operation to complete with a specified timeout. + This will return if the operation completed successfully before the timeout expired, otherwise. + If the operation was rejected or canceled, the appropriate exception will be thrown. + + + If a representing -1 millisecond is specified for the timeout parameter, this method blocks indefinitely until the operation is complete. + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + + Mark this as awaited and wait for the operation to complete with a specified timeout, without throwing. wraps the completion state and reason. + This will return if the operation completed successfully before the timeout expired, otherwise. + + + If a representing -1 millisecond is specified for the timeout parameter, this method blocks indefinitely until the operation is complete. + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + + Mark this as awaited and get a new that inherits the state of this and can be awaited once. + Preserved promises are unsafe to return from public APIs. Use to get a that is publicly safe. + is safe to call even if you are unsure if this is preserved. + + + + + Mark this as awaited and schedule the next continuation to execute on the context of the provided option. + Returns a new that inherits the state of this, or will be canceled if/when the is canceled before this is complete. + + Indicates on which context the next continuation will be executed. + If true, forces the next continuation to be invoked asynchronously. If is , this value will be ignored. + If canceled before this is complete, the returned will be canceled, and the cancelation will propagate on the context of the provided . + + + + Mark this as awaited and schedule the next continuation to execute on . + Returns a new that inherits the state of this, or will be canceled if/when the is canceled before this is complete. + + The context on which context the next continuation will be executed. If null, will be used. + If true, forces the next continuation to be invoked asynchronously. + If canceled before this is complete, the returned will be canceled, and the cancelation will propagate on the provided . + + + + Returns a new that inherits the state of this, or will be canceled if/when the is canceled before the continuation is invoked. + + + + + Add a progress listener. Returns a new . + + If/when this is resolved, will be invoked with 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + Will be reported with progress that is normalized between 0 and 1 on the context of the provided option. + Indicates on which context will be reported. + If true, forces progress invoke to happen asynchronously. If is , this value will be ignored. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Add a progress listener. Returns a new . + + If/when this is resolved, will be invoked with 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + Will be reported with progress that is normalized between 0 and 1 on the context of the provided option. + The context on which will be reported. If null, will be used. + If true, forces progress invoke to happen asynchronously. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Add a progress listener. Returns a new . + + If/when this is resolved, will be invoked with 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + Will be invoked with progress that is normalized between 0 and 1 on the context of the provided option. + Indicates on which context will be invoked. + If true, forces progress invoke to happen asynchronously. If is , this value will be ignored. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Add a progress listener. Returns a new . + + If/when this is resolved, will be invoked with 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + Will be invoked with progress that is normalized between 0 and 1 on the context of the provided option. + The context on which will be invoked. If null, will be used. + If true, forces progress invoke to happen asynchronously. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Add a finally callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked. + If throws an exception, the new will be rejected with that exception, + otherwise it will be resolved, rejected, or canceled with the same value or reason as this. + + + + + Add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a continuation callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with the , and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a continuation callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with the , and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a continuation callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with the , and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a continuation callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with the , and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a progress listener. Returns a new . + will be invoked that is normalized between 0 and 1 on the context of the provided option. + + If/when this is resolved, will be invoked with and 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, will stop being invoked. + + The value that will be passed to . + Will be invoked with with and progress that is normalized between 0 and 1 on the context of the provided option. + Indicates on which context will be invoked. + If true, forces progress invoke to happen asynchronously. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Capture a value and add a progress listener. Returns a new . + + If/when this is resolved, will be invoked with and 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + The value that will be passed to . + Will be invoked with with and progress that is normalized between 0 and 1 on the context of the provided option. + The context on which will be invoked. If null, will be used. + If true, forces progress invoke to happen asynchronously. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Capture a value and add a finally callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with . + If throws an exception, the new will be rejected with that exception, + otherwise it will be resolved, rejected, or canceled with the same value or reason as this. + + + + + Capture a value and add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a continuation callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with and the , and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a continuation callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with and the , and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a continuation callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with and the , and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a continuation callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with and the , and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + Returns a value indicating whether this value is equal to a specified . + + + Returns a value indicating whether this value is equal to a specified . + + + Returns the hash code for this instance. + + + Returns a value indicating whether two values are equal. + + + Returns a value indicating whether two values are not equal. + + + + Gets the string representation of this instance. + + The string representation of this instance. + + + Executes a for loop in which iterations may run in parallel on . + The start index, inclusive. + The end index, exclusive. + An asynchronous delegate that is invoked once per element in the data source. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + A promise that represents the entire for each operation. + + + Executes a for loop in which iterations may run in parallel on . + The start index, inclusive. + The end index, exclusive. + An asynchronous delegate that is invoked once per element in the data source. + The synchronization context on which the iterations will be ran. If null, will be used. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + A promise that represents the entire for each operation. + + + Executes a for loop in which iterations may run in parallel on . + The start index, inclusive. + The end index, exclusive. + The captured value that will be passed to the . + An asynchronous delegate that is invoked once per element in the data source. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + A promise that represents the entire for each operation. + + + Executes a for loop in which iterations may run in parallel on . + The start index, inclusive. + The end index, exclusive. + The captured value that will be passed to the . + An asynchronous delegate that is invoked once per element in the data source. + The synchronization context on which the iterations will be ran. If null, will be used. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel on . + The type of the data in the source. + An enumerable data source. + An asynchronous delegate that is invoked once per element in the data source. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel. + The type of the data in the source. + An enumerable data source. + An asynchronous delegate that is invoked once per element in the data source. + The synchronization context on which the iterations will be ran. If null, will be used. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel on . + The type of the data in the source. + The type of the captured value. + An enumerable data source. + The captured value that will be passed to the . + An asynchronous delegate that is invoked once per element in the data source. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel. + The type of the data in the source. + The type of the captured value. + An enumerable data source. + The captured value that will be passed to the . + An asynchronous delegate that is invoked once per element in the data source. + The synchronization context on which the iterations will be ran. If null, will be used. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + + Runs in sequence, returning a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Runs in sequence, returning a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + If the is canceled before all of the have been invoked, + the will stop being invoked, and the returned will be canceled. + + + + + Runs in sequence, returning a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Runs in sequence, returning a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + If the is canceled before all of the have been invoked, + the will stop being invoked, and the returned will be canceled. + + + + + Runs in sequence, returning a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Runs in sequence, returning a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + If the is canceled before all of the have been invoked, + the will stop being invoked, and the returned will be canceled. + + + + + Returns a new that will resolve on the foreground context. + + If true, forces the context switch to happen asynchronously. + + + + Returns a new that will resolve on the background context. + + If true, forces the context switch to happen asynchronously. + + + + Returns a new that will resolve on the provided + + The context to switch to. If null, will be used. + If true, forces the context switch to happen asynchronously. + + + + Switch to the foreground context in an async method. + + If true, forces the context switch to happen asynchronously. + + This method is equivalent to , but is more efficient when used directly with the keyword. + + + + + Switch to the background context in an async method. + + If true, forces the context switch to happen asynchronously. + + This method is equivalent to , butbut is more efficient when used directly with the keyword. + + + + + Switch to the provided context in an async method. + + The context to switch to. If null, will be used. + If true, forces the context switch to happen asynchronously. + + This method is equivalent to , but is more efficient when used directly with the keyword. + + + + + Returns a new . is invoked with a that controls the state of the new . + You may provide a to control the context on which the is invoked. + If throws an and the is still pending, the new will be canceled if it is an , + or rejected with that . + + The resolver delegate that will control the completion of the returned via the passed in . + Indicates on which context the will be invoked. + If true, forces the to be invoked asynchronously. If is , this value will be ignored. + + + + Returns a new . is invoked with a that controls the state of the new on the provided . + If throws an and the is still pending, the new will be canceled if it is an , + or rejected with that . + + The resolver delegate that will control the completion of the returned via the passed in . + The context on which the will be invoked. If null, will be used. + If true, forces the to be invoked asynchronously. + + + + Returns a new . is invoked with and a that controls the state of the . + You may provide a to control the context on which the is invoked. + If throws an and the is still pending, the new will be canceled if it is an , + or rejected with that . + + The value that will be passed to . + The resolver delegate that will control the completion of the returned via the passed in . + Indicates on which context the will be invoked. + If true, forces the to be invoked asynchronously. If is , this value will be ignored. + + + + Returns a new . is invoked with and a that controls the state of the on the provided . + If throws an and the is still pending, the new will be canceled if it is an , + or rejected with that . + + The value that will be passed to . + The resolver delegate that will control the completion of the returned via the passed in . + The context on which the will be invoked. If null, will be used. + If true, forces the to be invoked asynchronously. + + + + Run the on the provided context. Returns a new that will be resolved when the returns successfully. + If the throws an , the new will be canceled if it is an , or rejected with that . + + The delegate that will be invoked. + Indicates on which context the will be invoked. + If true, forces the invoke to happen asynchronously. If is , this value will be ignored. + + + + Run the with on the provided context. Returns a new that will be resolved when the returns successfully. + If the throws an , the new will be canceled if it is an , or rejected with that . + + The value that will be passed to . + The delegate that will be invoked. + Indicates on which context the will be invoked. + If true, forces the invoke to happen asynchronously. If is , this value will be ignored. + + + + Run the on the provided . Returns a new that will be resolved when the returns successfully. + If the throws an , the new will be canceled if it is an , or rejected with that . + + The delegate that will be invoked. + The context on which the will be invoked. If null, will be used. + If true, forces the invoke to happen asynchronously. + + + + Run the with on the provided . Returns a new that will be resolved when the returns successfully. + If the throws an , the new will be canceled if it is an , or rejected with that . + + The value that will be passed to . + The delegate that will be invoked. + The context on which the will be invoked. If null, will be used. + If true, forces the invoke to happen asynchronously. + + + + Run the on the provided context. Returns a new that will be resolved with the value returned by the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The delegate that will be invoked. + Indicates on which context the will be invoked. + If true, forces the invoke to happen asynchronously. If is , this value will be ignored. + + + + Run the with on the provided context. Returns a new that will be resolved with the value returned by the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The value that will be passed to . + The delegate that will be invoked. + Indicates on which context the will be invoked. + If true, forces the invoke to happen asynchronously. If is , this value will be ignored. + + + + Run the on the provided . Returns a new that will be resolved with the value returned by the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The delegate that will be invoked. + The context on which the will be invoked. If null, will be used. + If true, forces the invoke to happen asynchronously. + + + + Run the with on the provided . Returns a new that will be resolved with the value returned by the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The value that will be passed to . + The delegate that will be invoked. + The context on which the will be invoked. If null, will be used. + If true, forces the invoke to happen asynchronously. + + + + Run the on the provided context. Returns a new that will adopt the state of the returned from the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The delegate that will be invoked. + Indicates on which context the will be invoked. + If true, forces the invoke to happen asynchronously. If is , this value will be ignored. + + + + Run the with on the provided context. Returns a new that will adopt the state of the returned from the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The value that will be passed to . + The delegate that will be invoked. + Indicates on which context the will be invoked. + If true, forces the invoke to happen asynchronously. If is , this value will be ignored. + + + + Run the on the provided . Returns a new that will adopt the state of the returned from the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The delegate that will be invoked. + The context on which the will be invoked. If null, will be used. + If true, forces the invoke to happen asynchronously. + + + + Run the with on the provided . Returns a new that will adopt the state of the returned from the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The value that will be passed to . + The delegate that will be invoked. + The context on which the will be invoked. If null, will be used. + If true, forces the invoke to happen asynchronously. + + + + Run the on the provided context. Returns a new that will adopt the state of the returned from the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The delegate that will be invoked. + Indicates on which context the will be invoked. + If true, forces the invoke to happen asynchronously. If is , this value will be ignored. + + + + Run the with on the provided context. Returns a new that will adopt the state of the returned from the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The value that will be passed to . + The delegate that will be invoked. + Indicates on which context the will be invoked. + If true, forces the invoke to happen asynchronously. If is , this value will be ignored. + + + + Run the on the provided . Returns a new that will adopt the state of the returned from the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The delegate that will be invoked. + The context on which the will be invoked. If null, will be used. + If true, forces the invoke to happen asynchronously. + + + + Run the with on the provided . Returns a new that will adopt the state of the returned from the . + If the throws an , the new will be canceled if it is an , or rejected with that . + + The value that will be passed to . + The delegate that will be invoked. + The context on which the will be invoked. If null, will be used. + If true, forces the invoke to happen asynchronously. + + + + Returns a that is already resolved. + + + + + Returns a that is already resolved with . + + + + + Returns a that is already rejected with . + + + + + Returns a that is already canceled. + + + + + Returns a that is already canceled. + + + + + Returns a new instance that is linked to and controls the state of a new . + + + + + Returns a new instance that is linked to and controls the state of a new . + If the is canceled while the is pending, it and the will be canceled. + + + + + Returns a object that is linked to and controls the state of a new . + + + + + Returns a object that is linked to and controls the state of a new . + If the is canceled while the is pending, it and the will be canceled. + + + + + Get a that can be thrown inside an onRejected callback to rethrow the caught rejection, preserving the stack trace. + This should be used as "throw Promise.Rethrow;" + This is similar to "throw;" in a synchronous catch clause. + + + + + Get a that can be thrown to cancel the promise from an onResolved or onRejected callback, or in an async Promise function. + This should be used as "throw Promise.CancelException();" + + + + + Get a that can be thrown to reject the promise from an onResolved or onRejected callback, or in an async Promise function. + This should be used as "throw Promise.RejectException(value);" + + + + + Returns a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when all promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when all have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when all have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when all have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve with the value of when both promises have resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve with the values of the promises when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the promises has resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the promises has resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the promises has resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the has resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the has resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the has resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the has resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the promises has resolved. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the promises has resolved. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the promises has resolved. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the has resolved. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the has resolved. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the has resolved. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the has resolved. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a of that will resolve when the first of the promises has resolved with the index and result of that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Used to get the state and/or reason of a settled . + + + + + FOR INTERNAL USE ONLY! + + + + + FOR INTERNAL USE ONLY! + + + + + FOR INTERNAL USE ONLY! + + + + + If the is rejected or canceled, rethrow the reason. + + + + + If the is rejected, rethrow the rejection. + + + + + If the is canceled, rethrow the cancelation. + + + + + Get the state of the . + + + + + Gets the reason of the rejected . + + + + + A represents the eventual result of an asynchronous operation. + The primary ways of interacting with a are via the `await` keyword in an async function, + or its then method, which registers callbacks to be invoked with its resolve value when the is resolved, + or the reason why the cannot be resolved. + + + + Gets an awaiter for this . + This method is intended for compiler use rather than use directly in code. + The awaiter. + + + Gets an awaiter for this that suppresses throws and returns a instead. + The awaiter. + Use as `var resultContainer = await promise.AwaitNoThrow();` + + + + Gets an awaiter for this that supports reporting progress to the async or function. + The progress reported will be lerped from to . Both values must be between 0 and 1 inclusive. + + The awaiter. + Use as `await promise.AwaitWithProgress(minProgress, maxProgress);` + + + + Gets an awaiter for this that supports reporting progress to the async or function. + The progress reported will be lerped from its current progress to . must be between 0 and 1 inclusive. + + The awaiter. + + If the previously awaited promise did not complete successfully, minProgress will be set to the previous instead of current. + Use as `await promise.AwaitWithProgress(maxProgress);` + + + + + Gets an awaiter for this that supports reporting progress to the async or function, + and suppresses throws and returns a instead. + The progress reported will be lerped from to . Both values must be between 0 and 1 inclusive. + + The awaiter. + Use as `var resultContainer = await promise.AwaitWithProgressNoThrow(minProgress, maxProgress);` + + + + Gets an awaiter for this that supports reporting progress to the async or function, + and suppresses throws and returns a instead. + The progress reported will be lerped from its current progress to . must be between 0 and 1 inclusive. + + The awaiter. + + If the previously awaited promise did not complete successfully, minProgress will be set to the previous instead of current. + Use as `var resultContainer = await promise.AwaitWithProgressNoThrow(maxProgress);` + + + + + An instance of this is used to report progress and resolve, reject, or cancel the attached . + + + + + The attached that this controls. + + + + + Get whether or not this instance and the attached are valid. + + + + + Get whether or not this instance is valid and the attached is still pending. + + + + + Internal use. + + + + + Returns a new instance that is linked to and controls the state of a new . + + + + + Returns a new instance that is linked to and controls the state of a new . + If the is canceled while the is pending, it and the will be canceled. + + + + + Resolve the linked with . + + + + + + Try to resolve the linked with . + Returns true if successful, false otherwise. + + + + + Reject the linked with . + + + + + + Try to reject the linked with . + Returns true if successful, false otherwise. + + + + + Cancel the linked . + + + + + + Try to cancel the linked . + Returns true if successful, false otherwise. + + + + + Report progress between 0 and 1. + + + + + + + Try to report progress between 0 and 1. + Returns true if successful, false otherwise. + + + + + + Cast to . + + + + + Cast to . + + + + Returns a value indicating whether this value is equal to a specified . + + + Returns a value indicating whether this value is equal to a specified . + + + Returns the hash code for this instance. + + + Returns a value indicating whether two values are equal. + + + Returns a value indicating whether two values are not equal. + + + + The delegate type used for . + + The container from which the promise's state and result or reason can be extracted. + + + + The delegate type used for . + + The value that was passed to . + The container from which the promise's state and result or reason can be extracted. + + + + The delegate type used for . + + The container from which the promise's state and result or reason can be extracted. + + + + The delegate type used for . + + The value that was passed to . + The container from which the promise's state and result or reason can be extracted. + + + + Internal use. + + + + + Internal use. + + + + + Internal use. + + + + + Internal use. + + + + + Internal use. + + + + + Internal use. + + + + + Internal use. + + + + Executes a for each operation on an in which iterations may run in parallel on . + An enumerable data source. + An asynchronous delegate that is invoked once per element in the data source. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel. + An enumerable data source. + An asynchronous delegate that is invoked once per element in the data source. + The synchronization context on which the iterations will be ran. If null, will be used. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel on . + The type of the captured value. + An enumerable data source. + The captured value that will be passed to the . + An asynchronous delegate that is invoked once per element in the data source. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel. + The type of the captured value. + An enumerable data source. + The captured value that will be passed to the . + An asynchronous delegate that is invoked once per element in the data source. + The synchronization context on which the iterations will be ran. If null, will be used. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel on . + The type of the enumerator. + An enumerable data source. + An asynchronous delegate that is invoked once per element in the data source. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel. + The type of the enumerator. + An enumerable data source. + An asynchronous delegate that is invoked once per element in the data source. + The synchronization context on which the iterations will be ran. If null, will be used. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel on . + The type of the enumerator. + The type of the captured value. + An enumerable data source. + The captured value that will be passed to the . + An asynchronous delegate that is invoked once per element in the data source. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + Executes a for each operation on an in which iterations may run in parallel. + The type of the enumerator. + The type of the captured value. + An enumerable data source. + The captured value that will be passed to the . + An asynchronous delegate that is invoked once per element in the data source. + The synchronization context on which the iterations will be ran. If null, will be used. + A cancelation token that may be used to cancel the for each operation. + The maximum number of concurrent iterations. If -1, this value will be set to . + The exception that is thrown when the argument or argument is null. + A promise that represents the entire for each operation. + + + + Gets whether this instance is valid to be awaited. + + + + + Cast to . + + + + + Cast to . + + + + + Mark this as awaited and get a new of that inherits the state of this and can be awaited multiple times until is called on it. + must be called when you are finished with it. + NOTE: You should not return a preserved from a public API. Use to get a that is publicly safe. + + + + + Mark this as awaited and prevent any further awaits or callbacks on this. + NOTE: It is imperative to terminate your promise chains with Forget so that any uncaught rejections will be reported and objects repooled (if pooling is enabled). + + + + + Mark this as awaited and wait for the operation to complete. Returns the result of the operation. + If the operation was rejected or canceled, the appropriate exception will be thrown. + + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + Mark this as awaited and wait for the operation to complete, without throwing. Returns a that wraps the completion state and result or reason of the operation. + + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + Mark this as awaited and wait for the operation to complete with a specified timeout. + If the operation completed successfully before the timeout expired, this will return and will be assigned from the result of the operation. Otherwise, this will return . + If the operation was rejected or canceled, the appropriate exception will be thrown. + + + If a representing -1 millisecond is specified for the timeout parameter, this method blocks indefinitely until the operation is complete. + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + + Mark this as awaited and wait for the operation to complete with a specified timeout. + If the operation completed successfully before the timeout expired, this will return and will be assigned from the result of the operation. Otherwise, this will return . + If the operation was rejected or canceled, the appropriate exception will be thrown. + + + If a representing -1 millisecond is specified for the timeout parameter, this method blocks indefinitely until the operation is complete. + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + + Mark this as awaited and wait for the operation to complete with a specified timeout, without throwing. + If the operation completed successfully before the timeout expired, this will return and will be assigned from the result of the operation. Otherwise, this will return . + If the operation was rejected or canceled, the appropriate exception will be thrown. + + + If a representing -1 millisecond is specified for the timeout parameter, this method blocks indefinitely until the operation is complete. + Warning: this may cause a deadlock if you are not careful. Make sure you know what you are doing! + + + + + Mark this as awaited and get a new of that inherits the state of this and can be awaited once. + Preserved promises are unsafe to return from public APIs. Use to get a that is publicly safe. + is safe to call even if you are unsure if this is preserved. + + + + + Mark this as awaited and schedule the next continuation to execute on the context of the provided . + Returns a new that inherits the state of this, or will be canceled if/when the is canceled before this is complete. + + Indicates on which context the next continuation will be executed. + If true, forces the next continuation to be invoked asynchronously. If is , this value will be ignored. + If canceled before this is complete, the returned will be canceled, and the cancelation will propagate on the context of the provided . + + + + Mark this as awaited and schedule the next continuation to execute on . + Returns a new that inherits the state of this, or will be canceled if/when the is canceled before this is complete. + + The context on which context the next continuation will be executed. If null, will be used. + If true, forces the next continuation to be invoked asynchronously. + If canceled before this is complete, the returned will be canceled, and the cancelation will propagate on the provided . + + + + Returns a new that inherits the state of this, or will be canceled if/when the is canceled before the continuation is invoked. + + + + + Add a progress listener. Returns a new of . + + If/when this is resolved, will be invoked with 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + Will be reported with progress that is normalized between 0 and 1 on the context of the provided option. + Indicates on which context will be reported. + If true, forces progress invoke to happen asynchronously. If is , this value will be ignored. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Add a progress listener. Returns a new of . + + If/when this is resolved, will be invoked with 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + Will be reported with progress that is normalized between 0 and 1 on the context of the provided option. + The context on which will be reported. If null, will be used. + If true, forces progress invoke to happen asynchronously. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Add a progress listener. Returns a new of . + + If/when this is resolved, will be invoked with 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + Will be invoked with progress that is normalized between 0 and 1 on the context of the provided option. + Indicates on which context will be invoked. + If true, forces progress invoke to happen asynchronously. If is , this value will be ignored. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Add a progress listener. Returns a new of . + + If/when this is resolved, will be invoked with 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + Will be invoked with progress that is normalized between 0 and 1 on the context of the provided option. + The context on which will be invoked. If null, will be used. + If true, forces progress invoke to happen asynchronously. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Add a finally callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked. + If throws an exception, the new will be rejected with that exception, + otherwise it will be resolved, rejected, or canceled with the same value or reason as this. + + + + + Add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved with the same value. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved with the same value. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new of . + If/when this is resolved, the new will be resolved with the resolve value. + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new of . + If/when this is resolved, the new will be resolved with the resolve value. + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new of . + If/when this is resolved, the new will be resolved with the resolve value. + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new of . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved with the resolve value. + If/when this is canceled or rejected with any other reason or no reason, the new will be canceled or rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a continuation callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with the , and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a continuation callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with the , and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a continuation callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with the , and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a continuation callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with the , and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a progress listener. Returns a new of . + + If/when this is resolved, will be invoked with and 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + The value that will be passed to . + Will be invoked with progress that is normalized between 0 and 1 on the context of the provided option. + Indicates on which context will be invoked. + If true, forces progress invoke to happen asynchronously. If is , this value will be ignored. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Capture a value and add a progress listener. Returns a new of . + + If/when this is resolved, will be invoked with and 1.0, then the new will be resolved when it returns. + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + The value that will be passed to . + Will be invoked with progress that is normalized between 0 and 1 on the context of the provided option. + The context on which will be invoked. If null, will be used. + If true, forces progress invoke to happen asynchronously. + If canceled while this is pending, progress will stop being reported. This will not cancel the returned . + + + + Capture a value and add a finally callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with . + If throws an exception, the new will be rejected with that exception, + otherwise it will be resolved, rejected, or canceled with the same value or reason as this. + + + + + Capture a value and add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved with the same value. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved with the same value. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new of . + If/when this is resolved, the new will be resolved with the resolve value. + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new of . + If/when this is resolved, the new will be resolved with the resolve value. + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new of . + If/when this is resolved, the new will be resolved with the resolve value. + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new of . + If/when this is resolved, the new will be resolved with the resolve value. + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with and the resolve value, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a continuation callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with and the , and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a continuation callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with and the , and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a continuation callback. Returns a new . + When this is resolved, rejected, or canceled, will be invoked with and the , and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a continuation callback. Returns a new of . + When this is resolved, rejected, or canceled, will be invoked with and the , and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If if throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a cancel callback. Returns a new . + If/when this is canceled, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that , unless it is a Special Exception (see README). + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, the new will be rejected with the same reason. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a reject callback. Returns a new . + If/when this is resolved, the new will be resolved. + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved when it returns. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason, will be invoked with , and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture a value and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked, and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + + Capture 2 values and add a resolve and a reject callback. Returns a new of . + If/when this is resolved, will be invoked with , and the new will adopt the state of the returned . + If it throws an , the new will be rejected with that . + If/when this is rejected with any reason that is assignable to , will be invoked with and that reason, and the new will be resolved with the returned value. + If it throws an , the new will be rejected with that . + If this is rejected with any other reason, the new will be rejected with the same reason. + If/when this is canceled, the new will be canceled. + + If the is canceled while this is pending, the new will be canceled, and and will not be invoked. + + + + Returns a value indicating whether this value is equal to a specified . + + + Returns a value indicating whether this value is equal to a specified . + + + Returns the hash code for this instance. + + + Returns a value indicating whether two values are equal. + + + Returns a value indicating whether two values are not equal. + + + + Gets the string representation of this instance. + + The string representation of this instance. + + + + Returns a that will resolve when the first of the promises has resolved with the same value as that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the promises has resolved with the same value as that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the promises has resolved with the same value as that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the has resolved with the same value as that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the has resolved with the same value as that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the has resolved with the same value as that promise. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve when the first of the promises has resolved with the same value as that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the promises has resolved with the same value as that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the promises has resolved with the same value as that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the has resolved with the same value as that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the has resolved with the same value as that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve when the first of the has resolved with the same value as that promise. + If all promises are rejected or canceled, the returned will be canceled or rejected with the same reason as the last that is rejected or canceled. + + + + + Returns a that will resolve with a list of the promises' values in the same order when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + The first promise to combine. + The second promise to combine. + Optional list that will be used to contain the resolved values. If it is not provided, a new one will be created. + + + + Returns a that will resolve with a list of the promises' values in the same order when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + The first promise to combine. + The second promise to combine. + The third promise to combine. + Optional list that will be used to contain the resolved values. If it is not provided, a new one will be created. + + + + Returns a that will resolve with a list of the promises' values in the same order when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + The first promise to combine. + The second promise to combine. + The third promise to combine. + The fourth promise to combine. + Optional list that will be used to contain the resolved values. If it is not provided, a new one will be created. + + + + Returns a that will resolve with a list of values in the same order as when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + + + + Returns a that will resolve with a list of values in the same order as when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + The promises to combine. + Optional list that will be used to contain the resolved values. If it is not provided, a new one will be created. + + + + Returns a that will resolve with a list of values in the same order as s when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + The promises to combine. + Optional list that will be used to contain the resolved values. If it is not provided, a new one will be created. + + + + Returns a that will resolve a list of values in the same order as when they have all resolved. + If any promise is rejected or canceled, the returned will immediately be canceled or rejected with the same reason. + + The enumerator of promises to combine. + Optional list that will be used to contain the resolved values. If it is not provided, a new one will be created. + + + + Returns a new . is invoked with a that controls the state of the new . + You may provide a to control the context on which the is invoked. + If throws an and the is still pending, the new will be canceled if it is an , + or rejected with that + + The resolver delegate that will control the completion of the returned via the passed in . + Indicates on which context the will be invoked. + If true, forces the to be invoked asynchronously. If is , this value will be ignored. + + + + Returns a new . is invoked with and a that controls the state of the new . + You may provide a to control the context on which the is invoked. + If throws an and the is still pending, the new will be canceled if it is an , + or rejected with that + + The value that will be passed to . + The resolver delegate that will control the completion of the returned via the passed in . + Indicates on which context the will be invoked. + If true, forces the to be invoked asynchronously. If is , this value will be ignored. + + + + Returns a new . is invoked with a that controls the state of the new on the provided . + If throws an and the is still pending, the new will be canceled if it is an , + or rejected with that + + The resolver delegate that will control the completion of the returned via the passed in . + The context on which the will be invoked. If null, will be used. + If true, forces the to be invoked asynchronously. + + + + Returns a new . is invoked with and a that controls the state of the new on the provided . + If throws an and the is still pending, the new will be canceled if it is an , + or rejected with that + + The value that will be passed to . + The resolver delegate that will control the completion of the returned via the passed in . + The context on which the will be invoked. If null, will be used. + If true, forces the to be invoked asynchronously. + + + + Returns a that is already resolved with . + + + + + Returns a that is already rejected with . + + + + + Returns a that is already canceled. + + + + + Returns a object that is linked to and controls the state of a new . + + + + + Returns a object that is linked to and controls the state of a new . + If the is canceled while the is pending, it and the will be canceled. + + + + + Used to get the state and result or reason of a settled . + + + + + FOR INTERNAL USE ONLY! + + + + + FOR INTERNAL USE ONLY! + + + + + If the is rejected or canceled, rethrow the reason. + + + + + If the is rejected, rethrow the rejection. + + + + + If the is canceled, rethrow the cancelation. + + + + + Get the state of the . + + + + + Gets the result of the resolved . + + + + + Gets the reason of the rejected . + + + + + Cast to . + + + + + Generic Array enumerator. Use this instead of the default for passing it around as an . + + + + + Provides an awaiter for awaiting a . + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Ends the await on the completed . + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten, or it has not yet completed. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Provides an awaiter for awaiting a . + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Ends the await on the completed . + The result of the completed + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten, or it has not yet completed. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Provides an awaiter for awaiting a , without throwing. + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Ends the await on the completed . + A that wraps the completion state and reason of the . + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten, or it has not yet completed. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Provides an awaiter for awaiting a , without throwing. + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Ends the await on the completed . + A that wraps the completion state and result or reason of the . + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten, or it has not yet completed. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Provides an awaiter for awaiting a and reporting its progress to the associated async or . + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Ends the await on the completed . + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten, or it has not yet completed. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Provides an awaiter for awaiting a and reporting its progress to the associated async or . + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Ends the await on the completed . + The result of the completed + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten, or it has not yet completed. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Provides an awaiter for awaiting a and reporting its progress to the associated async or , without throwing. + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Ends the await on the completed . + A that wraps the completion state and reason of the . + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten, or it has not yet completed. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Provides an awaiter for awaiting a and reporting its progress to the associated async or , without throwing. + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Ends the await on the completed . + A that wraps the completion state and result or reason of the . + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten, or it has not yet completed. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Provides a builder for asynchronous methods that return . + This type is intended for compiler use only. + + + + + Schedules the specified state machine to be pushed forward when the specified awaiter completes. + + Specifies the type of the awaiter. + Specifies the type of the state machine. + The awaiter. + The state machine. + + + + Schedules the specified state machine to be pushed forward when the specified awaiter completes. + + Specifies the type of the awaiter. + Specifies the type of the state machine. + The awaiter. + The state machine. + + + Initiates the builder's execution with the associated state machine. + Specifies the type of the state machine. + The state machine instance, passed by reference. + + + Does nothing. + The heap-allocated state machine object. + + + Gets the for this builder. + The representing the builder's asynchronous operation. + + + Initializes a new . + The initialized . + + + + Completes the in the Rejected state with the specified exception. + + The to use to reject the promise. + + + + Completes the in the Resolved state. + + + + + Provides a builder for asynchronous methods that return . + This type is intended for compiler use only. + + + + + Schedules the specified state machine to be pushed forward when the specified awaiter completes. + + Specifies the type of the awaiter. + Specifies the type of the state machine. + The awaiter. + The state machine. + + + + Schedules the specified state machine to be pushed forward when the specified awaiter completes. + + Specifies the type of the awaiter. + Specifies the type of the state machine. + The awaiter. + The state machine. + + + Initiates the builder's execution with the associated state machine. + Specifies the type of the state machine. + The state machine instance, passed by reference. + + + Does nothing. + The heap-allocated state machine object. + + + Gets the for this builder. + The representing the builder's asynchronous operation. + + + Initializes a new . + The initialized . + + + + Completes the in the Rejected state with the specified exception. + + The to use to reject the promise. + + + + Completes the in the Resolved state with the specified result. + + The result to use to complete the task. + + + + Provides an awaiter for switching to a context. + + This type is intended for compiler use rather than use directly in code. + + + + Internal use. + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the being awaited is completed. + This property is intended for compiler use rather than use directly in code. + + + Ends the await on the context. + This property is intended for compiler use rather than use directly in code. + + + Schedules the continuation onto the context. + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + + + Schedules the continuation onto the context. + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + + + + How the next continuation should be scheduled. + + + + + Schedule the next continuation to execute synchronously. + + + + + Schedule the next continuation to execute on the . + + + + + Schedule the next continuation to execute on the . + + + + + Exception that is thrown if a promise is rejected and that rejection is never handled. + + + + + Exception that is used to propagate cancelation of an operation. + + + + + Special Exception that is used to rethrow a rejection from a Promise onRejected callback. + + + + + Special Exception that is used to reject a Promise from an onResolved or onRejected callback. + + + + + Used to get the value of a rejection or cancelation. + An instance of is only valid during the invocation of the delegate it is passed into. + + + + + FOR INTERNAL USE ONLY! + + + + + Get the type of the value. + + + + + Get the value. + + + + + Try to get the value casted to . + Returns true if successful, false otherwise. + + + + + An async-compatible auto-reset event. + + + + + Creates an async-compatible auto-reset event. + + Whether the auto-reset event is initially set or unset. + + + + Creates an async-compatible auto-reset event that is initially unset. + + + + + Whether this event is currently set. + + + + + Asynchronously wait for this event to be set. + + + + + Asynchronously wait for this event to be set, or for the to be canceled. + + The used to cancel the wait. + + The result of the returned will be if this is set before the was canceled, otherwise it will be . + If this is already set, the result will be , even if the is already canceled. + + + + + Synchronously wait for this event to be set. + + + + + Synchronously wait for this event to be set, or for the to be canceled. + + The used to cancel the wait. + + The returned value will be if this is set before the was canceled, otherwise it will be . + If this is already set, the result will be , even if the is already canceled. + + + + + Sets this event, completing a waiter. + + + If there are any pending waiters, this event will be reset, and a single waiter will be completed atomically. + If this event is already set, this does nothing. + + + + + Resets this event. + + + If this event is already reset, this does nothing. + + + + + Asynchronous infrastructure support. This method permits instances of to be awaited. + + + + + An async-compatible countdown event. + + + + + Creates an async-compatible countdown event. + + The number of signals initially required to set the . + + + + Gets the number of remaining signals required to set the event. + + + + + Gets the numbers of signals initially required to set the event. + + + + + Increments by one. + + The current instance is already set, or the is equal to or greater than . + + + + Increments by a specified value. + + The value by which to increase . + is less than or equal to 0. + + The current instance is already set, or + is equal to or greater than . + + + + + Attempts to increment by one. + + if the increment succeeded; otherwise, . If is already 0, this will return . + is equal to or greater than . + + + + Attempts to increment by a specified value. + + The value by which to increase . + if the increment succeeded; otherwise, . If is already 0, this will return . + is less than or equal to 0. + + is equal to or greater than . + + + + Resets the to the value of . + + + + + Resets the and to a specified value. + + + + + Registers a signal with the , decrementing the value of . + + if the signal caused the count to reach zero and the event was set; otherwise, . + The current instance is already set. + + + + Registers multiple signals with the , decrementing the value of by the specified amount. + + The number of signals to register. + if the signals caused the count to reach zero and the event was set; otherwise, . + is less than 1. + The current instance is already set, or is greater than . + + + + Asynchronously wait for this event to be set. + + + + + Asynchronously wait for this event to be set, or for the to be canceled. + + The used to cancel the wait. + + The result of the returned will be if this is set before the was canceled, otherwise it will be . + If this is already set, the result will be , even if the is already canceled. + + + + + Synchronously wait for this event to be set. + + + + + Synchronously wait for this event to be set, or for the to be canceled. + + The used to cancel the wait. + + The returned value will be if this is set before the was canceled, otherwise it will be . + If this is already set, the result will be , even if the is already canceled. + + + + + Asynchronous infrastructure support. This method permits instances of to be awaited. + + + + + An async-compatible manual-reset event. + + + + + Creates an async-compatible manual-reset event. + + Whether the manual-reset event is initially set or unset. + + + + Creates an async-compatible manual-reset event that is initially unset. + + + + + Whether this event is currently set. + + + + + Asynchronously wait for this event to be set. + + + + + Asynchronously wait for this event to be set, or for the to be canceled. + + The used to cancel the wait. + + The result of the returned will be if this is set before the was canceled, otherwise it will be . + If this is already set, the result will be , even if the is already canceled. + + + + + Synchronously wait for this event to be set. + + + + + Synchronously wait for this event to be set, or for the to be canceled. + + The used to cancel the wait. + + The returned value will be if this is set before the was canceled, otherwise it will be . + If this is already set, the result will be , even if the is already canceled. + + + + + Sets this event, completing every wait. + + + If this event is already set, this does nothing. + + + + + Resets this event. + + + If this event is already reset, this does nothing. + + + + + Asynchronous infrastructure support. This method permits instances of to be awaited. + + + + + An async-compatible manual-reset event. + + + + + Creates an async-compatible Semaphore, specifying + the initial number of requests that can be granted concurrently. + + The initial number of requests for the semaphore that can be granted + concurrently. + is less than 0. + + + + Creates an async-compatible Semaphore, specifying + the initial and maximum number of requests that can be granted concurrently. + + The initial number of requests for the semaphore that can be granted + concurrently. + The maximum number of requests for the semaphore that can be granted + concurrently. + + is less than 0. -or- + is greater than . -or- + is equal to or less than 0. + + + + Get the number of times remaining that this can be entered concurrently. + + + The initial value of the property is set by the call to the class constructor. + It is decremented by each call to the or methods, and incremented by each call to the method. + + + + + Asynchronously wait to enter this . + + + + + Asynchronously wait to enter this , or for the to be canceled. + + The used to cancel the wait. + + The result of the returned will be if this is entered before the was canceled, otherwise it will be . + If this is available to be entered, the result will be , even if the is already canceled. + + + + + Synchronously wait to enter this . + + + + + Synchronously wait to enter this , or for the to be canceled. + + The used to cancel the wait. + + The returned value will be if this is entered before the was canceled, otherwise it will be . + If this is available to be entered, the result will be , even if the is already canceled. + + + + + Exit this once. + + + + + Exit this a specified number of times. + + + + + A used to schedule callbacks to the thread that it was created on. + + + + + Create a new affiliated with the current thread. + + + + + Create a new affiliated with the . + + + + + Create copy. + + this + + + + Schedule the delegate to execute on this context with the given state asynchronously, without waiting for it to complete. + + + + + Schedule the delegate to execute on this context with the given state, and wait for it to complete. + + + + + Execute all callbacks that have been scheduled to run on this context. + + If this is called on a different thread than this was created on, or if this is called recursively. + If one or more callbacks throw an exception, they will be wrapped and rethrown as . + + + + Provides support for asynchronous lazy initialization. + + The type of object that is being lazily initialized. + + + + Initializes a new instance of the class that uses the specified initialization function. + + The delegate that is invoked to produce the lazily initialized value when it is needed. + + + + Whether the asynchronous factory method has started. This is initially false and becomes true when this instance is awaited or after is accessed. + + This reverts to false if the factory does not complete successfully. + + + + Starts the asynchronous factory method, if it has not already started, and returns the resulting . + + + + + Asynchronous infrastructure support. This method permits instances of to be awaited. + + + + + Indicates that the use of on a member is meant to be treated as a tuple with element names. + + + + + Initializes a new instance of the class. + + + Specifies, in a prefix traversal of a type's + construction, which occurrences are meant to + carry element names. + + + This constructor is meant to be used on types that are built on an underlying + occurrence of that is meant to carry element names. + For instance, if C is a generic type with two type parameters, then a + use of the constructed type C{, + might be intended to treat the first type argument as a tuple with element names + and the second as a tuple without element names. In which case, the appropriate attribute + specification should use transformNames value of { "name1", "name2", null }. + + + + + Initializes a new instance of the class. + + + When is created with this constructor, + it can be omitted instead. + + + + + Specifies, in a prefix traversal of a type's + construction, which occurrences are meant to + carry element names. + + + + + This interface is required for types that want to be indexed into by dynamic patterns. + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + + Helper so we can call some tuple methods recursively without knowing the underlying types. + + + + + The ValueTuple types (from arity 0 to 8) comprise the runtime implementation that underlies tuples in C# and struct tuples in F#. + Aside from created via language syntax, they are most easily created via the ValueTuple.Create factory methods. + The System.ValueTuple types differ from the System.Tuple types in that: + - they are structs rather than classes, + - they are mutable rather than readonly, and + - their members (such as Item1, Item2, etc) are fields rather than properties. + + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if is a . + + + Returns a value indicating whether this instance is equal to a specified value. + An instance to compare to this instance. + true if has the same value as this instance; otherwise, false. + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + Returns the hash code for this instance. + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (). + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + Creates a new struct 0-tuple. + A 0-tuple. + + + Creates a new struct 1-tuple, or singleton. + The type of the first component of the tuple. + The value of the first component of the tuple. + A 1-tuple (singleton) whose value is (item1). + + + Creates a new struct 2-tuple, or pair. + The type of the first component of the tuple. + The type of the second component of the tuple. + The value of the first component of the tuple. + The value of the second component of the tuple. + A 2-tuple (pair) whose value is (item1, item2). + + + Creates a new struct 3-tuple, or triple. + The type of the first component of the tuple. + The type of the second component of the tuple. + The type of the third component of the tuple. + The value of the first component of the tuple. + The value of the second component of the tuple. + The value of the third component of the tuple. + A 3-tuple (triple) whose value is (item1, item2, item3). + + + Creates a new struct 4-tuple, or quadruple. + The type of the first component of the tuple. + The type of the second component of the tuple. + The type of the third component of the tuple. + The type of the fourth component of the tuple. + The value of the first component of the tuple. + The value of the second component of the tuple. + The value of the third component of the tuple. + The value of the fourth component of the tuple. + A 4-tuple (quadruple) whose value is (item1, item2, item3, item4). + + + Creates a new struct 5-tuple, or quintuple. + The type of the first component of the tuple. + The type of the second component of the tuple. + The type of the third component of the tuple. + The type of the fourth component of the tuple. + The type of the fifth component of the tuple. + The value of the first component of the tuple. + The value of the second component of the tuple. + The value of the third component of the tuple. + The value of the fourth component of the tuple. + The value of the fifth component of the tuple. + A 5-tuple (quintuple) whose value is (item1, item2, item3, item4, item5). + + + Creates a new struct 6-tuple, or sextuple. + The type of the first component of the tuple. + The type of the second component of the tuple. + The type of the third component of the tuple. + The type of the fourth component of the tuple. + The type of the fifth component of the tuple. + The type of the sixth component of the tuple. + The value of the first component of the tuple. + The value of the second component of the tuple. + The value of the third component of the tuple. + The value of the fourth component of the tuple. + The value of the fifth component of the tuple. + The value of the sixth component of the tuple. + A 6-tuple (sextuple) whose value is (item1, item2, item3, item4, item5, item6). + + + Creates a new struct 7-tuple, or septuple. + The type of the first component of the tuple. + The type of the second component of the tuple. + The type of the third component of the tuple. + The type of the fourth component of the tuple. + The type of the fifth component of the tuple. + The type of the sixth component of the tuple. + The type of the seventh component of the tuple. + The value of the first component of the tuple. + The value of the second component of the tuple. + The value of the third component of the tuple. + The value of the fourth component of the tuple. + The value of the fifth component of the tuple. + The value of the sixth component of the tuple. + The value of the seventh component of the tuple. + A 7-tuple (septuple) whose value is (item1, item2, item3, item4, item5, item6, item7). + + + Creates a new struct 8-tuple, or octuple. + The type of the first component of the tuple. + The type of the second component of the tuple. + The type of the third component of the tuple. + The type of the fourth component of the tuple. + The type of the fifth component of the tuple. + The type of the sixth component of the tuple. + The type of the seventh component of the tuple. + The type of the eighth component of the tuple. + The value of the first component of the tuple. + The value of the second component of the tuple. + The value of the third component of the tuple. + The value of the fourth component of the tuple. + The value of the fifth component of the tuple. + The value of the sixth component of the tuple. + The value of the seventh component of the tuple. + The value of the eighth component of the tuple. + An 8-tuple (octuple) whose value is (item1, item2, item3, item4, item5, item6, item7, item8). + + + Represents a 1-tuple, or singleton, as a value type. + The type of the tuple's only component. + + + + The current instance's first component. + + + + + Initializes a new instance of the value type. + + The value of the tuple's first component. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if the current instance is equal to the specified object; otherwise, . + + The parameter is considered to be equal to the current instance under the following conditions: + + It is a value type. + Its components are of the same types as those of the current instance. + Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + + + + + + Returns a value that indicates whether the current + instance is equal to a specified . + + The tuple to compare with this instance. + if the current instance is equal to the specified tuple; otherwise, . + + The parameter is considered to be equal to the current instance if each of its field + is equal to that of the current instance, using the default comparer for that field's type. + + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + + Returns the hash code for the current instance. + + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (Item1), + where Item1 represents the value of . If the field is , + it is represented as . + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + + Represents a 2-tuple, or pair, as a value type. + + The type of the tuple's first component. + The type of the tuple's second component. + + + + The current instance's first component. + + + + + The current instance's second component. + + + + + Initializes a new instance of the value type. + + The value of the tuple's first component. + The value of the tuple's second component. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if the current instance is equal to the specified object; otherwise, . + + + The parameter is considered to be equal to the current instance under the following conditions: + + It is a value type. + Its components are of the same types as those of the current instance. + Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + + + + + + Returns a value that indicates whether the current instance is equal to a specified . + + The tuple to compare with this instance. + if the current instance is equal to the specified tuple; otherwise, . + + The parameter is considered to be equal to the current instance if each of its fields + are equal to that of the current instance, using the default comparer for that field's type. + + + + + Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. + + The object to compare with this instance. + An object that defines the method to use to evaluate whether the two objects are equal. + if the current instance is equal to the specified object; otherwise, . + + + This member is an explicit interface member implementation. It can be used only when the + instance is cast to an interface. + + The implementation is called only if other is not , + and if it can be successfully cast (in C#) or converted (in Visual Basic) to a + whose components are of the same types as those of the current instance. The IStructuralEquatable.Equals(Object, IEqualityComparer) method + first passes the values of the objects to be compared to the + implementation. If this method call returns , the method is + called again and passed the values of the two instances. + + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + + Returns the hash code for the current instance. + + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (Item1, Item2), + where Item1 and Item2 represent the values of the + and fields. If either field value is , + it is represented as . + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + + Represents a 3-tuple, or triple, as a value type. + + The type of the tuple's first component. + The type of the tuple's second component. + The type of the tuple's third component. + + + + The current instance's first component. + + + + + The current instance's second component. + + + + + The current instance's third component. + + + + + Initializes a new instance of the value type. + + The value of the tuple's first component. + The value of the tuple's second component. + The value of the tuple's third component. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if the current instance is equal to the specified object; otherwise, . + + The parameter is considered to be equal to the current instance under the following conditions: + + It is a value type. + Its components are of the same types as those of the current instance. + Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + + + + + + Returns a value that indicates whether the current + instance is equal to a specified . + + The tuple to compare with this instance. + if the current instance is equal to the specified tuple; otherwise, . + + The parameter is considered to be equal to the current instance if each of its fields + are equal to that of the current instance, using the default comparer for that field's type. + + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + + Returns the hash code for the current instance. + + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (Item1, Item2, Item3). + If any field value is , it is represented as . + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + + Represents a 4-tuple, or quadruple, as a value type. + + The type of the tuple's first component. + The type of the tuple's second component. + The type of the tuple's third component. + The type of the tuple's fourth component. + + + + The current instance's first component. + + + + + The current instance's second component. + + + + + The current instance's third component. + + + + + The current instance's fourth component. + + + + + Initializes a new instance of the value type. + + The value of the tuple's first component. + The value of the tuple's second component. + The value of the tuple's third component. + The value of the tuple's fourth component. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if the current instance is equal to the specified object; otherwise, . + + The parameter is considered to be equal to the current instance under the following conditions: + + It is a value type. + Its components are of the same types as those of the current instance. + Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + + + + + + Returns a value that indicates whether the current + instance is equal to a specified . + + The tuple to compare with this instance. + if the current instance is equal to the specified tuple; otherwise, . + + The parameter is considered to be equal to the current instance if each of its fields + are equal to that of the current instance, using the default comparer for that field's type. + + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + + Returns the hash code for the current instance. + + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (Item1, Item2, Item3, Item4). + If any field value is , it is represented as . + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + + Represents a 5-tuple, or quintuple, as a value type. + + The type of the tuple's first component. + The type of the tuple's second component. + The type of the tuple's third component. + The type of the tuple's fourth component. + The type of the tuple's fifth component. + + + + The current instance's first component. + + + + + The current instance's second component. + + + + + The current instance's third component. + + + + + The current instance's fourth component. + + + + + The current instance's fifth component. + + + + + Initializes a new instance of the value type. + + The value of the tuple's first component. + The value of the tuple's second component. + The value of the tuple's third component. + The value of the tuple's fourth component. + The value of the tuple's fifth component. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if the current instance is equal to the specified object; otherwise, . + + The parameter is considered to be equal to the current instance under the following conditions: + + It is a value type. + Its components are of the same types as those of the current instance. + Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + + + + + + Returns a value that indicates whether the current + instance is equal to a specified . + + The tuple to compare with this instance. + if the current instance is equal to the specified tuple; otherwise, . + + The parameter is considered to be equal to the current instance if each of its fields + are equal to that of the current instance, using the default comparer for that field's type. + + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + + Returns the hash code for the current instance. + + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (Item1, Item2, Item3, Item4, Item5). + If any field value is , it is represented as . + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + + Represents a 6-tuple, or sixtuple, as a value type. + + The type of the tuple's first component. + The type of the tuple's second component. + The type of the tuple's third component. + The type of the tuple's fourth component. + The type of the tuple's fifth component. + The type of the tuple's sixth component. + + + + The current instance's first component. + + + + + The current instance's second component. + + + + + The current instance's third component. + + + + + The current instance's fourth component. + + + + + The current instance's fifth component. + + + + + The current instance's sixth component. + + + + + Initializes a new instance of the value type. + + The value of the tuple's first component. + The value of the tuple's second component. + The value of the tuple's third component. + The value of the tuple's fourth component. + The value of the tuple's fifth component. + The value of the tuple's sixth component. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if the current instance is equal to the specified object; otherwise, . + + The parameter is considered to be equal to the current instance under the following conditions: + + It is a value type. + Its components are of the same types as those of the current instance. + Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + + + + + + Returns a value that indicates whether the current + instance is equal to a specified . + + The tuple to compare with this instance. + if the current instance is equal to the specified tuple; otherwise, . + + The parameter is considered to be equal to the current instance if each of its fields + are equal to that of the current instance, using the default comparer for that field's type. + + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + + Returns the hash code for the current instance. + + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (Item1, Item2, Item3, Item4, Item5, Item6). + If any field value is , it is represented as . + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + + Represents a 7-tuple, or sentuple, as a value type. + + The type of the tuple's first component. + The type of the tuple's second component. + The type of the tuple's third component. + The type of the tuple's fourth component. + The type of the tuple's fifth component. + The type of the tuple's sixth component. + The type of the tuple's seventh component. + + + + The current instance's first component. + + + + + The current instance's second component. + + + + + The current instance's third component. + + + + + The current instance's fourth component. + + + + + The current instance's fifth component. + + + + + The current instance's sixth component. + + + + + The current instance's seventh component. + + + + + Initializes a new instance of the value type. + + The value of the tuple's first component. + The value of the tuple's second component. + The value of the tuple's third component. + The value of the tuple's fourth component. + The value of the tuple's fifth component. + The value of the tuple's sixth component. + The value of the tuple's seventh component. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if the current instance is equal to the specified object; otherwise, . + + The parameter is considered to be equal to the current instance under the following conditions: + + It is a value type. + Its components are of the same types as those of the current instance. + Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + + + + + + Returns a value that indicates whether the current + instance is equal to a specified . + + The tuple to compare with this instance. + if the current instance is equal to the specified tuple; otherwise, . + + The parameter is considered to be equal to the current instance if each of its fields + are equal to that of the current instance, using the default comparer for that field's type. + + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + + Returns the hash code for the current instance. + + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (Item1, Item2, Item3, Item4, Item5, Item6, Item7). + If any field value is , it is represented as . + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + + Represents an 8-tuple, or octuple, as a value type. + + The type of the tuple's first component. + The type of the tuple's second component. + The type of the tuple's third component. + The type of the tuple's fourth component. + The type of the tuple's fifth component. + The type of the tuple's sixth component. + The type of the tuple's seventh component. + The type of the tuple's eighth component. + + + + The current instance's first component. + + + + + The current instance's second component. + + + + + The current instance's third component. + + + + + The current instance's fourth component. + + + + + The current instance's fifth component. + + + + + The current instance's sixth component. + + + + + The current instance's seventh component. + + + + + The current instance's eighth component. + + + + + Initializes a new instance of the value type. + + The value of the tuple's first component. + The value of the tuple's second component. + The value of the tuple's third component. + The value of the tuple's fourth component. + The value of the tuple's fifth component. + The value of the tuple's sixth component. + The value of the tuple's seventh component. + The value of the tuple's eight component. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + The object to compare with this instance. + if the current instance is equal to the specified object; otherwise, . + + The parameter is considered to be equal to the current instance under the following conditions: + + It is a value type. + Its components are of the same types as those of the current instance. + Its components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component. + + + + + + Returns a value that indicates whether the current + instance is equal to a specified . + + The tuple to compare with this instance. + if the current instance is equal to the specified tuple; otherwise, . + + The parameter is considered to be equal to the current instance if each of its fields + are equal to that of the current instance, using the default comparer for that field's type. + + + + Compares this instance to a specified instance and returns an indication of their relative values. + An instance to compare. + + A signed number indicating the relative values of this instance and . + Returns less than zero if this instance is less than , zero if this + instance is equal to , and greater than zero if this instance is greater + than . + + + + + Returns the hash code for the current instance. + + A 32-bit signed integer hash code. + + + + Returns a string that represents the value of this instance. + + The string representation of this instance. + + The string returned by this method takes the form (Item1, Item2, Item3, Item4, Item5, Item6, Item7, Rest). + If any field value is , it is represented as . + + + + + The number of positions in this data structure. + + + + + Get the element at position . + + + + diff --git a/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.xml.meta b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.xml.meta new file mode 100644 index 0000000..6789463 --- /dev/null +++ b/demo/Assets/Packages/ProtoPromise.2.5.0/lib/net35/Release/ProtoPromise.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a9cf411fd257e4b49a9fc1aeef9571bc +timeCreated: 1684393130 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0.meta b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0.meta new file mode 100644 index 0000000..e76a46c --- /dev/null +++ b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b9ace1905767aaf4d8d9a14ccdcddc53 +folderAsset: yes +timeCreated: 1684393107 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib.meta b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib.meta new file mode 100644 index 0000000..72ee3e7 --- /dev/null +++ b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 415800021210e4340bb5a64d333b457f +folderAsset: yes +timeCreated: 1684393107 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35.meta b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35.meta new file mode 100644 index 0000000..5b82d07 --- /dev/null +++ b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d8edec1f3f514874cbb8e1de466c1f39 +folderAsset: yes +timeCreated: 1684393107 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release.meta b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release.meta new file mode 100644 index 0000000..05bf8fe --- /dev/null +++ b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 74ae7fc5a174d2d459b6667abe84da08 +folderAsset: yes +timeCreated: 1684393108 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.dll b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.dll new file mode 100644 index 0000000..761ac1c Binary files /dev/null and b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.dll differ diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.dll.meta b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.dll.meta new file mode 100644 index 0000000..cc71901 --- /dev/null +++ b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.dll.meta @@ -0,0 +1,34 @@ +fileFormatVersion: 2 +guid: 86e52029f9c9fe145938a6c4be2a93da +timeCreated: 1684393114 +licenseType: Free +PluginImporter: + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + data: + first: + Any: + second: + enabled: 1 + settings: {} + data: + first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + data: + first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.pdb.meta b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.pdb.meta new file mode 100644 index 0000000..ba255ec --- /dev/null +++ b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.pdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c055be5d55ae379449583e9c0d0e1794 +timeCreated: 1684393109 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.xml b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.xml new file mode 100644 index 0000000..9f96910 --- /dev/null +++ b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.xml @@ -0,0 +1,528 @@ + + + + ProtoPromiseUnityHelpers + + + + + Yielder used to wait for a yield instruction to complete in the form of a Promise, using Unity's coroutines. + + + + + Returns a that will resolve after the has completed. + + The yield instruction to wait for. + The instance on which the will be ran. + The used to stop the internal wait and cancel the promise. + + If is provided, the coroutine will be ran on it, otherwise it will be ran on the singleton PromiseYielder instance. + + + + + Returns a that will resolve after 1 frame. + + The instance on which the wait will be ran. + + If is provided, the coroutine will be ran on it, otherwise it will be ran on the singleton PromiseYielder instance. + + + + + Returns a that will complete after 1 frame. + + + + + Returns a that will complete after the specified number of frames have passed. + + How many frames to wait for. + + + + Returns a that will complete after the specified timespan has passed, using scaled time. + + How much time to wait for. + + + + Returns a that will complete after the specified timespan has passed, using unscaled, real time. + + How much time to wait for. + + + + Returns a that will complete when the supplied delegate returns true. + + The function that will be ran to determine if the wait should complete. + + + + Returns a that will complete when the supplied delegate returns true. + + The value that will be passed to the delegate. + The function that will be ran to determine if the wait should complete. + + + + Returns a that will complete when the supplied delegate returns false. + + The function that will be ran to determine if the wait should complete. + + + + Returns a that will complete when the supplied delegate returns false. + + The value that will be passed to the delegate. + The function that will be ran to determine if the wait should complete. + + + + Returns a that will complete when the is complete. + + + + + Returns a that will complete at the next end of frame. + + + + + Returns a that will complete at the next fixed update. + + + + + Contains instructions returned by functions. + + + + + Awaiter used to wait for a single frame to pass. + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the operation is complete. + This property is intended for compiler use rather than use directly in code. + false + + + Called after the operation has completed. + This property is intended for compiler use rather than use directly in code. + + + Schedules the continuation. + The action to invoke when the operation completes. + This property is intended for compiler use rather than use directly in code. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Await instruction used to wait a number of frames. + + + + + Gets a new . + + + + + Converts this to a . + + + + + Await instruction used to wait an amount of time, scaled to the game clock. + + + + + Gets a new . + + + + + Converts this to a . + + + + + Await instruction used to wait an amount of time, using unscaled, real time. + + + + + Gets a new . + + + + + Converts this to a . + + + + + Await instruction used to wait until a condition is true. + + + + + Gets a new . + + + + + Converts this to a . + + + + + Await instruction used to wait until a condition is true. + + + + + Gets a new . + + + + + Converts this to a . + + + + + Await instruction used to wait while a condition is true. + + + + + Gets a new . + + + + + Converts this to a . + + + + + Await instruction used to wait while a condition is true. + + + + + Gets a new . + + + + + Converts this to a . + + + + + Await instruction used to wait for an . + + + + + Gets a new . + + + + + Converts this to a . + + + + + Awaiter used to wait for a context (FixedUpdate, EndOfFrame). + + + + Gets the awaiter for this. + This method is intended for compiler use rather than use directly in code. + this + + + Gets whether the operation is complete. + This property is intended for compiler use rather than use directly in code. + false + + + Called after the operation has completed. + This property is intended for compiler use rather than use directly in code. + + + Schedules the continuation. + The action to invoke when the operation completes. + This property is intended for compiler use rather than use directly in code. + + + Schedules the continuation onto the associated with this . + The action to invoke when the await operation completes. + This property is intended for compiler use rather than use directly in code. + The has already been awaited or forgotten. + + + + Interface used to await a condition. + + + + + Continues the async function when it returns true. + + + + + Interface used to await a condition with progress. + + + + + Continues the async function when it returns true. Progress may be reported. + + + + + Awaiter extensions facilitating the `await` keyword on await instructions. + + + + + Helper interface intended for internal use. + + + + + Returns self. + + + + + Gets whether this is complete. + + + + + Completes the await. + + + + + Awaiter facilitating the `await` keyword on await instructions. + + + + + Creates a new awaiter wrapping the instruction. + + + + + Creates a new awaiter wrapping the , with cancelation. + + + + + Returns a duplicate awaiter with cancelation. + + + + + Gets whether this is complete. + + + + + Returns self. + + + + + Schedules the continuation. + + + + + Schedules the continuation. + + + + + Completes the await. + + + + + Gets an awaiter wrapping the . + + + + + Gets an awaiter wrapping the , with cancelation. + + + + + Converts the to a . + + + + + Converts the to a . + + + + + Awaiter extensions facilitating the `await` keyword on await instructions. + + + + + Awaiter facilitating the `await` keyword on await instructions. + + + + + Creates a new awaiter wrapping the . + + + + + Creates a new awaiter wrapping the , with cancelation. + + + + + Returns a duplicate awaiter with cancelation. + + + + + Gets whether this is complete. + + + + + Returns self. + + + + + Schedules the continuation. + + + + + Schedules the continuation. + + + + + Completes the await. + + + + + Gets an awaiter wrapping the . + + + + + Gets an awaiter wrapping the , with cancelation. + + + + + Gets an awaiter wrapping the , with progress reported to the `async Promise` function, optionally with cancelation. + + + + + Gets an awaiter wrapping the , with progress reported to the `async Promise` function, optionally with cancelation. + + + + + Converts the to a . + + + + + Extensions to convert Promises to Yield Instructions for Coroutines. + + + + + Convert the to a . + + + + + Convert the to a . + + + + + Yield instruction that can be yielded in a coroutine to wait until the it came from has settled. + + + + + The state of the this came from. + + The state. + + + + Is the Promise still pending? + + + + + Get the result. If the Promise resolved successfully, this will return without error. + If the Promise was rejected or canceled, this will throw the appropriate exception. + + + + + Adds this object back to the pool if object pooling is enabled. + Don't try to access it after disposing! Results are undefined. + + Call when you are finished using the + . The method leaves the + in an unusable state. After calling + , you must release all references to the + so the garbage collector can reclaim the memory + that the was occupying. + + + + Yield instruction that can be yielded in a coroutine to wait until the it came from has settled. + An instance of this should be disposed when you are finished with it. + + + + + Get the result. If the Promise resolved successfully, this will return the result of the operation. + If the Promise was rejected or canceled, this will throw the appropriate exception. + + + + diff --git a/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.xml.meta b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.xml.meta new file mode 100644 index 0000000..163da04 --- /dev/null +++ b/demo/Assets/Packages/ProtoPromiseUnityHelpers.2.5.0/lib/net35/Release/ProtoPromiseUnityHelpers.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 122c7b15b4f8ceb4485248f5f7ffee64 +timeCreated: 1684393129 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/demo/Assets/Packages/Proyecto26.RestClient.2.6.2/lib/net35/Proyecto26.RestClient.dll b/demo/Assets/Packages/Proyecto26.RestClient.2.6.2/lib/net35/Proyecto26.RestClient.dll index a142173..438287d 100755 Binary files a/demo/Assets/Packages/Proyecto26.RestClient.2.6.2/lib/net35/Proyecto26.RestClient.dll and b/demo/Assets/Packages/Proyecto26.RestClient.2.6.2/lib/net35/Proyecto26.RestClient.dll differ diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/RSG.Promise.3.0.1.nupkg b/demo/Assets/Packages/RSG.Promise.3.0.1/RSG.Promise.3.0.1.nupkg deleted file mode 100644 index b58898c..0000000 Binary files a/demo/Assets/Packages/RSG.Promise.3.0.1/RSG.Promise.3.0.1.nupkg and /dev/null differ diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35/RSG.Promise.dll b/demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35/RSG.Promise.dll deleted file mode 100755 index 5adc469..0000000 Binary files a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35/RSG.Promise.dll and /dev/null differ diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35/RSG.Promise.dll.meta b/demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35/RSG.Promise.dll.meta deleted file mode 100644 index 242c953..0000000 --- a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/net35/RSG.Promise.dll.meta +++ /dev/null @@ -1,32 +0,0 @@ -fileFormatVersion: 2 -guid: 54d3a5fa1672546bcb20c38432ba5144 -timeCreated: 1547017322 -licenseType: Free -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0/RSG.Promise.dll b/demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0/RSG.Promise.dll deleted file mode 100755 index 3228717..0000000 Binary files a/demo/Assets/Packages/RSG.Promise.3.0.1/lib/netstandard2.0/RSG.Promise.dll and /dev/null differ diff --git a/demo/Assets/packages.config b/demo/Assets/packages.config index f304ffd..1b4b0c4 100644 --- a/demo/Assets/packages.config +++ b/demo/Assets/packages.config @@ -1,5 +1,6 @@  - + + \ No newline at end of file diff --git a/src/Proyecto26.RestClient/Helpers/HttpBase.cs b/src/Proyecto26.RestClient/Helpers/HttpBase.cs index 0859ddc..019bc86 100644 --- a/src/Proyecto26.RestClient/Helpers/HttpBase.cs +++ b/src/Proyecto26.RestClient/Helpers/HttpBase.cs @@ -3,6 +3,7 @@ using UnityEngine; using UnityEngine.Networking; using Proyecto26.Common; +using Proto.Promises; namespace Proyecto26 { @@ -70,6 +71,69 @@ public static IEnumerator CreateRequestAndRetry(RequestHelper options, Action CreateRequestAndRetryAsync(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) + { + var deferred = Promise.NewDeferred(); + RequestAndRetry(deferred, options, cancelationToken.GetRetainer()); + return options.ProgressCallback == null + ? deferred.Promise + : deferred.Promise.Progress(options.ProgressCallback); + } + + // async/await would be cleaner, but it's not available in old .Net 3.5 runtime. + private static void RequestAndRetry(Promise.Deferred deferred, RequestHelper opts, CancelationToken.Retainer cancelationRetainer, int currentRetryCount = 0) + { + var webRequest = CreateRequest(opts); + PromiseYielder.WaitForAsyncOperation(webRequest.SendWebRequestWithOptions(opts)) + .ToPromise(cancelationRetainer.token) + .Progress(deferred, (def, progress) => def.ReportProgress(progress)) + .Then(ValueTuple.Create(deferred, opts, currentRetryCount, webRequest, cancelationRetainer), tuple => + { + var def = tuple.Item1; + var options = tuple.Item2; + var retries = tuple.Item3; + var request = tuple.Item4; + var retainer = tuple.Item5; + +#if UNITY_2020_2_OR_NEWER + bool isNetworkError = (request.result == UnityWebRequest.Result.ConnectionError); +#else + bool isNetworkError = request.isNetworkError; +#endif + var response = request.CreateWebResponse(); + if (request.IsValidRequest(options)) + { + DebugLog(options.EnableDebug, string.Format("RestClient - Response\nUrl: {0}\nMethod: {1}\nStatus: {2}\nResponse: {3}", options.Uri, options.Method, request.responseCode, options.ParseResponseBody ? response.Text : "body not parsed"), false); + retainer.Dispose(); + def.Resolve(response); + } + else if (!options.IsAborted && retries < options.Retries && (!options.RetryCallbackOnlyOnNetworkErrors || isNetworkError)) + { + if (options.RetryCallback != null) + { + options.RetryCallback(CreateException(options, request), retries); + } + PromiseYielder.WaitForRealTime(TimeSpan.FromSeconds(options.RetrySecondsDelay)) + .ToPromise() + .Then(tuple, tup => + { + DebugLog(tup.Item2.EnableDebug, string.Format("RestClient - Retry Request\nUrl: {0}\nMethod: {1}", tup.Item2.Uri, tup.Item2.Method), false); + RequestAndRetry(tup.Item1, tup.Item2, tup.Item5, tup.Item3 + 1); + }) + .Forget(); + } + else + { + var err = CreateException(options, request); + DebugLog(options.EnableDebug, err, true); + retainer.Dispose(); + def.Reject(err); + } + }) + .Finally(webRequest, request => request.Dispose()) + .Forget(); + } + private static UnityWebRequest CreateRequest(RequestHelper options) { var url = options.Uri.BuildUrl(options.Params); @@ -135,6 +199,27 @@ public static IEnumerator DefaultUnityWebRequest(RequestHelper option }); } + public static Promise DefaultUnityWebRequestAsync(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) + { + return CreateRequestAndRetryAsync(options, cancelationToken) + .Then(res => + { + try + { + if (res.StatusCode != HTTP_NO_CONTENT && res.Data != null && options.ParseResponseBody) + { + return JsonUtility.FromJson(res.Text); + } + return default(TResponse); + } + catch (Exception error) + { + DebugLog(options.EnableDebug, string.Format("RestClient - Invalid JSON format\nError: {0}", error.Message), true); + throw new RequestException(error.Message); + } + }); + } + public static IEnumerator DefaultUnityWebRequest(RequestHelper options, Action callback) { return CreateRequestAndRetry(options, (RequestException err, ResponseHelper res) => { @@ -156,5 +241,26 @@ public static IEnumerator DefaultUnityWebRequest(RequestHelper option }); } + public static Promise DefaultUnityWebRequestArrayAsync(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) + { + return CreateRequestAndRetryAsync(options, cancelationToken) + .Then(res => + { + try + { + if (res.StatusCode != HTTP_NO_CONTENT && res.Data != null && options.ParseResponseBody) + { + return JsonHelper.ArrayFromJson(res.Text); + } + return default(TResponse[]); + } + catch (Exception error) + { + DebugLog(options.EnableDebug, string.Format("RestClient - Invalid JSON format\nError: {0}", error.Message), true); + throw new RequestException(error.Message); + } + }); + } + } } diff --git a/src/Proyecto26.RestClient/RestClientPromise.cs b/src/Proyecto26.RestClient/RestClientPromise.cs index 9d2ca35..d946f35 100644 --- a/src/Proyecto26.RestClient/RestClientPromise.cs +++ b/src/Proyecto26.RestClient/RestClientPromise.cs @@ -1,5 +1,5 @@ using Proto.Promises; -using System; +using UnityEngine.Networking; namespace Proyecto26 { @@ -13,11 +13,10 @@ public static partial class RestClient /// /// Returns a promise for a value of type ResponseHelper. /// The options of the request. - public static Promise Request(RequestHelper options) + /// The token used to abort the request. + public static Promise Request(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Request(options, GetCallback(options, deferred)); - return deferred.Promise; + return HttpBase.CreateRequestAndRetryAsync(options, cancelationToken); } /// @@ -25,12 +24,11 @@ public static Promise Request(RequestHelper options) /// /// Returns a promise for a value of a specified type. /// The options of the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Request(RequestHelper options) + public static Promise Request(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Request(options, GetCallback(options, deferred)); - return deferred.Promise; + return HttpBase.DefaultUnityWebRequestAsync(options, cancelationToken); } /// @@ -38,7 +36,8 @@ public static Promise Request(RequestHelper options) /// /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. - public static Promise Get(string url) + /// The token used to abort the request. + public static Promise Get(string url, CancelationToken cancelationToken = default(CancelationToken)) { return Get(new RequestHelper { Uri = url }); } @@ -48,11 +47,11 @@ public static Promise Get(string url) /// /// Returns a promise for a value of type ResponseHelper. /// The options of the request. - public static Promise Get(RequestHelper options) + /// The token used to abort the request. + public static Promise Get(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Get(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbGET; + return HttpBase.CreateRequestAndRetryAsync(options, cancelationToken); } /// @@ -61,7 +60,7 @@ public static Promise Get(RequestHelper options) /// Returns a promise for a value of a specified type. /// A string containing the URL to which the request is sent. /// The element type of the response. - public static Promise Get(string url) + public static Promise Get(string url, CancelationToken cancelationToken = default(CancelationToken)) { return Get(new RequestHelper { Uri = url }); } @@ -71,12 +70,12 @@ public static Promise Get(string url) /// /// Returns a promise for a value of a specified type. /// The options of the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Get(RequestHelper options) + public static Promise Get(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Get(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbGET; + return HttpBase.DefaultUnityWebRequestAsync(options, cancelationToken); } /// @@ -84,8 +83,9 @@ public static Promise Get(RequestHelper options) /// /// Returns a promise for an array of values. /// A string containing the URL to which the request is sent. + /// The token used to abort the request. /// The element type of the array. - public static Promise GetArray(string url) + public static Promise GetArray(string url, CancelationToken cancelationToken = default(CancelationToken)) { return GetArray(new RequestHelper { Uri = url }); } @@ -95,12 +95,12 @@ public static Promise GetArray(string url) /// /// Returns a promise for an array of values. /// The options of the request. + /// The token used to abort the request. /// The element type of the array. - public static Promise GetArray(RequestHelper options) + public static Promise GetArray(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - GetArray(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbGET; + return HttpBase.DefaultUnityWebRequestArrayAsync(options, cancelationToken); } /// @@ -109,7 +109,8 @@ public static Promise GetArray(RequestHelper options) /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. /// A plain object that is sent to the server with the request. - public static Promise Post(string url, object body) + /// The token used to abort the request. + public static Promise Post(string url, object body, CancelationToken cancelationToken = default(CancelationToken)) { return Post(new RequestHelper { Uri = url, Body = body }); } @@ -120,7 +121,8 @@ public static Promise Post(string url, object body) /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. /// A string that is sent to the server with the request. - public static Promise Post(string url, string bodyString) + /// The token used to abort the request. + public static Promise Post(string url, string bodyString, CancelationToken cancelationToken = default(CancelationToken)) { return Post(new RequestHelper { Uri = url, BodyString = bodyString }); } @@ -130,11 +132,11 @@ public static Promise Post(string url, string bodyString) /// /// Returns a promise for a value of type ResponseHelper. /// The options of the request. - public static Promise Post(RequestHelper options) + /// The token used to abort the request. + public static Promise Post(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Post(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbPOST; + return HttpBase.CreateRequestAndRetryAsync(options, cancelationToken); } /// @@ -143,8 +145,9 @@ public static Promise Post(RequestHelper options) /// Returns a promise for a value of a specified type. /// A string containing the URL to which the request is sent. /// A plain object that is sent to the server with the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Post(string url, object body) + public static Promise Post(string url, object body, CancelationToken cancelationToken = default(CancelationToken)) { return Post(new RequestHelper { Uri = url, Body = body }); } @@ -155,8 +158,9 @@ public static Promise Post(string url, object body) /// Returns a promise for a value of a specified type. /// A string containing the URL to which the request is sent. /// A string that is sent to the server with the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Post(string url, string bodyString) + public static Promise Post(string url, string bodyString, CancelationToken cancelationToken = default(CancelationToken)) { return Post(new RequestHelper { Uri = url, BodyString = bodyString }); } @@ -166,12 +170,12 @@ public static Promise Post(string url, string bodyString) /// /// Returns a promise for a value of a specified type. /// The options of the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Post(RequestHelper options) + public static Promise Post(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Post(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbPOST; + return HttpBase.DefaultUnityWebRequestAsync(options, cancelationToken); } /// @@ -180,8 +184,9 @@ public static Promise Post(RequestHelper options) /// Returns a promise for an array of values. /// A string containing the URL to which the request is sent. /// A plain object that is sent to the server with the request. + /// The token used to abort the request. /// The element type of the array. - public static Promise PostArray(string url, object body) + public static Promise PostArray(string url, object body, CancelationToken cancelationToken = default(CancelationToken)) { return PostArray(new RequestHelper { Uri = url, Body = body }); } @@ -192,8 +197,9 @@ public static Promise PostArray(string url, object body) /// Returns a promise for an array of values. /// A string containing the URL to which the request is sent. /// A string that is sent to the server with the request. + /// The token used to abort the request. /// The element type of the array. - public static Promise PostArray(string url, string bodyString) + public static Promise PostArray(string url, string bodyString, CancelationToken cancelationToken = default(CancelationToken)) { return PostArray(new RequestHelper { Uri = url, BodyString = bodyString }); } @@ -203,12 +209,12 @@ public static Promise PostArray(string url, string bodyString) /// /// Returns a promise for an array of values. /// The options of the request. + /// The token used to abort the request. /// The element type of the array. - public static Promise PostArray(RequestHelper options) + public static Promise PostArray(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - PostArray(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbPOST; + return HttpBase.DefaultUnityWebRequestArrayAsync(options, cancelationToken); } /// @@ -217,7 +223,8 @@ public static Promise PostArray(RequestHelper options) /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. /// A plain object that is sent to the server with the request. - public static Promise Put(string url, object body) + /// The token used to abort the request. + public static Promise Put(string url, object body, CancelationToken cancelationToken = default(CancelationToken)) { return Put(new RequestHelper { Uri = url, Body = body }); } @@ -228,7 +235,8 @@ public static Promise Put(string url, object body) /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. /// A string that is sent to the server with the request. - public static Promise Put(string url, string bodyString) + /// The token used to abort the request. + public static Promise Put(string url, string bodyString, CancelationToken cancelationToken = default(CancelationToken)) { return Put(new RequestHelper { Uri = url, BodyString = bodyString }); } @@ -238,11 +246,11 @@ public static Promise Put(string url, string bodyString) /// /// Returns a promise for a value of type ResponseHelper. /// The options of the request. - public static Promise Put(RequestHelper options) + /// The token used to abort the request. + public static Promise Put(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Put(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbPUT; + return HttpBase.CreateRequestAndRetryAsync(options, cancelationToken); } /// @@ -251,8 +259,9 @@ public static Promise Put(RequestHelper options) /// Returns a promise for a value of a specified type. /// A string containing the URL to which the request is sent. /// A plain object that is sent to the server with the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Put(string url, object body) + public static Promise Put(string url, object body, CancelationToken cancelationToken = default(CancelationToken)) { return Put(new RequestHelper { Uri = url, Body = body }); } @@ -263,8 +272,9 @@ public static Promise Put(string url, object body) /// Returns a promise for a value of a specified type. /// A string containing the URL to which the request is sent. /// A string that is sent to the server with the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Put(string url, string bodyString) + public static Promise Put(string url, string bodyString, CancelationToken cancelationToken = default(CancelationToken)) { return Put(new RequestHelper { Uri = url, BodyString = bodyString }); } @@ -274,12 +284,12 @@ public static Promise Put(string url, string bodyString) /// /// Returns a promise for a value of a specified type. /// The options of the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Put(RequestHelper options) + public static Promise Put(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Put(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbPUT; + return HttpBase.DefaultUnityWebRequestAsync(options, cancelationToken); } /// @@ -288,7 +298,8 @@ public static Promise Put(RequestHelper options) /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. /// A plain object that is sent to the server with the request. - public static Promise Patch(string url, object body) + /// The token used to abort the request. + public static Promise Patch(string url, object body, CancelationToken cancelationToken = default(CancelationToken)) { return Patch(new RequestHelper { Uri = url, Body = body }); } @@ -299,7 +310,8 @@ public static Promise Patch(string url, object body) /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. /// A string that is sent to the server with the request. - public static Promise Patch(string url, string bodyString) + /// The token used to abort the request. + public static Promise Patch(string url, string bodyString, CancelationToken cancelationToken = default(CancelationToken)) { return Patch(new RequestHelper { Uri = url, BodyString = bodyString }); } @@ -309,11 +321,11 @@ public static Promise Patch(string url, string bodyString) /// /// Returns a promise for a value of type ResponseHelper. /// The options of the request. - public static Promise Patch(RequestHelper options) + /// The token used to abort the request. + public static Promise Patch(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Patch(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = "PATCH"; + return HttpBase.CreateRequestAndRetryAsync(options, cancelationToken); } /// @@ -322,8 +334,9 @@ public static Promise Patch(RequestHelper options) /// Returns a promise for a value of a specified type. /// A string containing the URL to which the request is sent. /// A plain object that is sent to the server with the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Patch(string url, object body) + public static Promise Patch(string url, object body, CancelationToken cancelationToken = default(CancelationToken)) { return Patch(new RequestHelper { Uri = url, Body = body }); } @@ -334,8 +347,9 @@ public static Promise Patch(string url, object body) /// Returns a promise for a value of a specified type. /// A string containing the URL to which the request is sent. /// A string that is sent to the server with the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Patch(string url, string bodyString) + public static Promise Patch(string url, string bodyString, CancelationToken cancelationToken = default(CancelationToken)) { return Patch(new RequestHelper { Uri = url, BodyString = bodyString }); } @@ -345,12 +359,12 @@ public static Promise Patch(string url, string bodyString) /// /// Returns a promise for a value of a specified type. /// The options of the request. + /// The token used to abort the request. /// The element type of the response. - public static Promise Patch(RequestHelper options) + public static Promise Patch(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Patch(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = "PATCH"; + return HttpBase.DefaultUnityWebRequestAsync(options, cancelationToken); } /// @@ -358,7 +372,8 @@ public static Promise Patch(RequestHelper options) /// /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. - public static Promise Delete(string url) + /// The token used to abort the request. + public static Promise Delete(string url, CancelationToken cancelationToken = default(CancelationToken)) { return Delete(new RequestHelper { Uri = url }); } @@ -368,11 +383,11 @@ public static Promise Delete(string url) /// /// Returns a promise for a value of type ResponseHelper. /// The options of the request. - public static Promise Delete(RequestHelper options) + /// The token used to abort the request. + public static Promise Delete(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Delete(options, GetCallback(options, deferred)); - return deferred.Promise; + options.Method = UnityWebRequest.kHttpVerbDELETE; + return HttpBase.CreateRequestAndRetryAsync(options, cancelationToken); } /// @@ -380,7 +395,8 @@ public static Promise Delete(RequestHelper options) /// /// Returns a promise for a value of type ResponseHelper. /// A string containing the URL to which the request is sent. - public static Promise Head(string url) + /// The token used to abort the request. + public static Promise Head(string url, CancelationToken cancelationToken = default(CancelationToken)) { return Head(new RequestHelper { Uri = url }); } @@ -390,37 +406,11 @@ public static Promise Head(string url) /// /// Returns a promise for a value of type ResponseHelper. /// The options of the request. - public static Promise Head(RequestHelper options) + /// The token used to abort the request. + public static Promise Head(RequestHelper options, CancelationToken cancelationToken = default(CancelationToken)) { - var deferred = Promise.NewDeferred(); - Head(options, GetCallback(options, deferred)); - return deferred.Promise; - } - - #endregion - - #region Helpers - - private static Action GetCallback(RequestHelper options, Promise.Deferred deferred) - { - options.ProgressCallback += deferred.ReportProgress; - return (RequestException error, ResponseHelper response) => - { - if (error != null) { deferred.Reject(error); } else { deferred.Resolve(response); } - }; - } - - private static Action GetCallback(RequestHelper options, Promise.Deferred deferred) - { - options.ProgressCallback += deferred.ReportProgress; - return (RequestException error, ResponseHelper response, T body) => - { - if (error != null && response != null) - { - error.ServerMessage = response.Error ?? error.Message; - } - if (error != null) { deferred.Reject(error); } else { deferred.Resolve(body); } - }; + options.Method = UnityWebRequest.kHttpVerbHEAD; + return HttpBase.CreateRequestAndRetryAsync(options, cancelationToken); } #endregion