This type defines the Beamable Promise. More...
Public Member Functions | |
void | CompleteSuccess (T val) |
Call to set the value and resolve the Promise More... | |
void | CompleteError (Exception ex) |
Call to throw an exception and resolve the Promise More... | |
Promise< T > | Then (Action< T > callback) |
Call to register a success completion handler callback for the Promise More... | |
Promise< T > | Merge (Promise< T > other) |
Combine the outcome of this promise with the given promise. If this promise completes, the given promise will complete. If this promise fails, the given promise will fail. More... | |
Promise< T > | Error (Action< Exception > errback) |
Call to register a failure completion handler callback for the Promise More... | |
Promise< TU > | Map< TU > (Func< T, TU > callback) |
Takes a promise of type A, and returns a promise of type B with a conversion applied. More... | |
PromiseU | FlatMap< PromiseU, U > (Func< T, PromiseU > callback, Func< PromiseU > factory) |
Takes a promise of type A, and returns a promise of type B with a conversion applied and the promise hierarchy is flattened. More... | |
Promise< TU > | FlatMap< TU > (Func< T, Promise< TU > > callback) |
Takes a promise of type A, and returns a promise of type B with a conversion applied and the promise hierarchy is flattened. More... | |
T | GetResult () |
Get the result of the Promise. More... | |
Promise< T > | GetAwaiter () |
Get the awaiter of the Promise. Once an awaiter is established, this promise will never raise an uncaught exception. More... | |
void | CompleteSuccess () |
Static Public Member Functions | |
static Promise< T > | Successful (T value) |
Call to set the value and resolve the Promise More... | |
static Promise< T > | Failed (Exception err) |
Call to throw an exception and resolve the Promise More... | |
static SequencePromise< T > | ObservableSequence< T > (IList< Promise< T > > promises) |
Create a SequencePromise<T> from List of Promise<T> More... | |
static Promise< List< T > > | Sequence< T > (IList< Promise< T > > promises) |
Create a Promise of List from a List of Promises. More... | |
static Promise< List< T > > | Sequence< T > (params Promise< T >[] promises) |
Create Sequence Promise from an array of Promises. More... | |
static Promise< Unit > | ExecuteSerially< T > (List< Func< Promise< T > > > generators, Func< bool > stopWhen=null) |
Given a list of promise generator functions, process the whole list, but serially. Only one promise will be active at any given moment. More... | |
static SequencePromise< T > | ExecuteRolling< T > (int maxProcessSize, List< Func< Promise< T > > > generators, Func< bool > stopWhen=null) |
Given a list of promise generator functions, process the list, but in a rolling fashion. More... | |
static Promise< Unit > | ExecuteInBatch< T > (int maxBatchSize, List< Func< Promise< T > > > generators) |
Given a list of promise generator functions, process the list, but in batches of some size. The batches themselves will run one at a time. Every promise in the current batch must finish before the next batch can start. More... | |
static SequencePromise< T > | ExecuteInBatchSequence< T > (int maxBatchSize, List< Func< Promise< T > > > generators, Func< bool > stopWhen=null) |
![]() | |
static void | SetPotentialUncaughtErrorHandler (PromiseEvent handler, bool replaceExistingHandlers=true) |
Set error handlers for uncaught promise errors. Beamable has a default handler set in its API initialization. More... | |
Properties | |
static Promise | Success = new Promise { done = true } [get] |
![]() | |
bool | HadAnyErrbacks [getprotected set] |
True if there are any registered error handlers. | |
bool | done [getset] |
static Promise< Unit > | SuccessfulUnit [get] |
bool | IsCompleted [get] |
True when the promise has completed; false otherwise. | |
static bool | HasUncaughtErrorHandler [get] |
Additional Inherited Members | |
![]() | |
static readonly Unit | Unit = new Unit() |
![]() | |
void | InvokeUncaughtPromise () |
![]() | |
Action< Exception > | errbacks |
Exception | err |
ExceptionDispatchInfo | errInfo |
StackTrace | _errStackTrace |
object | _lock = new object() |
This type defines the Beamable Promise.
A promise is an object that may produce a single value some time in the future: either a resolved value, or a reason that it’s not resolved (e.g., a network error occurred).
|
inline |
Call to throw an exception and resolve the Promise
val |
|
inline |
Call to set the value and resolve the Promise
val |
|
inline |
Call to register a failure completion handler callback for the Promise
val |
|
inlinestatic |
Given a list of promise generator functions, process the list, but in batches of some size. The batches themselves will run one at a time. Every promise in the current batch must finish before the next batch can start.
maxBatchSize | |
generators |
T |
|
inlinestatic |
Given a list of promise generator functions, process the list, but in a rolling fashion.
maxProcessSize | |
generators | |
stopWhen |
T |
|
inlinestatic |
Given a list of promise generator functions, process the whole list, but serially. Only one promise will be active at any given moment.
generators |
T |
|
inlinestatic |
Call to throw an exception and resolve the Promise
err |
|
inline |
Takes a promise of type A, and returns a promise of type B with a conversion applied and the promise hierarchy is flattened.
callback | |
factory |
PromiseU | |
U |
PromiseU | : | Promise<U> |
|
inline |
Takes a promise of type A, and returns a promise of type B with a conversion applied and the promise hierarchy is flattened.
callback |
TU |
|
inline |
Get the awaiter of the Promise. Once an awaiter is established, this promise will never raise an uncaught exception.
Exception |
|
inline |
|
inline |
Takes a promise of type A, and returns a promise of type B with a conversion applied.
callback |
TU |
|
inline |
Combine the outcome of this promise with the given promise. If this promise completes, the given promise will complete. If this promise fails, the given promise will fail.
other | Some promise other than this promise. |
|
inlinestatic |
Create a SequencePromise<T> from List of Promise<T>
promises |
T |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Call to set the value and resolve the Promise
value |
|
inline |
Call to register a success completion handler callback for the Promise
val |