Beamable SDK
Public Member Functions | Properties | List of all members
Beamable.Common.SequencePromise< T > Class Template Reference

This type defines the Beamable SequencePromise. More...

Inheritance diagram for Beamable.Common.SequencePromise< T >:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Common.SequencePromise< T >:
Collaboration graph
[legend]

Public Member Functions

 SequencePromise (int count)
 
SequencePromise< T > OnElementError (Action< SequenceEntryException > handler)
 Attach a callback that will trigger anytime a promise fails More...
 
SequencePromise< T > OnElementSuccess (Action< SequenceEntrySuccess< T > > handler)
 Attach a callback that will trigger anytime a promise succeeds More...
 
void CompleteSuccess ()
 Mark the entire sequence promise as complete
 
void ReportEntryError (SequenceEntryException exception)
 When a promise has failed, report the failure. One failed promise will cause the entire sequence promise to be considered a failed promise. More...
 
void ReportEntrySuccess (SequenceEntrySuccess< T > success)
 When a promise has succeeded, report the success. All promises must report success for the entire sequence promise to succeed. More...
 
void ReportEntrySuccess (int index, T result)
 
void ReportEntryError (int index, Exception err)
 
- Public Member Functions inherited from Beamable.Common.Promise< IList< T > >
void CompleteSuccess (T val)
 Call to set the value and resolve the Promise More...
 
void CompleteSuccess ()
 
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...
 
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...
 

Properties

int SuccessCount [get]
 The current count of successful promises
 
int ErrorCount [get]
 The current count of failed promises
 
int Total [get]
 The current count of completed promises
 
int Count [get]
 The number of promises that this sequence reprensents
 
float Ratio [get]
 The ratio of completed promises to total promises. This will be 1 when all promises have completed.
 
bool HasProcessedAllEntries [get]
 True when all promises have completed; false otherwise
 
IEnumerable< T > SuccessfulResults [get]
 An enumeration of the successful results. There will be a T for each successful promise.
 
- Properties inherited from Beamable.Common.Promise< IList< T > >
static Promise Success [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Beamable.Common.Promise< IList< T > >
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< UnitExecuteSerially< 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< UnitExecuteInBatch< 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)
 

Detailed Description

This type defines the Beamable SequencePromise.

Related Links

img beamable-logo

Member Function Documentation

◆ OnElementError()

SequencePromise< T > Beamable.Common.SequencePromise< T >.OnElementError ( Action< SequenceEntryException handler)
inline

Attach a callback that will trigger anytime a promise fails

Parameters
handlerA callback that will be given a SequenceEntryException everytime a promise fails
Returns
This instance

◆ OnElementSuccess()

SequencePromise< T > Beamable.Common.SequencePromise< T >.OnElementSuccess ( Action< SequenceEntrySuccess< T > >  handler)
inline

Attach a callback that will trigger anytime a promise succeeds

Parameters
handlerA callback that will be given a SequenceEntrySuccess<T> everytime a promise succeeds
Returns
This instance

◆ ReportEntryError() [1/2]

void Beamable.Common.SequencePromise< T >.ReportEntryError ( int  index,
Exception  err 
)

Parameters
indexThe promise index that failed
errThe exception that failed the promise

◆ ReportEntryError() [2/2]

void Beamable.Common.SequencePromise< T >.ReportEntryError ( SequenceEntryException  exception)
inline

When a promise has failed, report the failure. One failed promise will cause the entire sequence promise to be considered a failed promise.

Parameters
exceptionThe SequenceEntryException that occured

◆ ReportEntrySuccess() [1/2]

void Beamable.Common.SequencePromise< T >.ReportEntrySuccess ( int  index,
result 
)

Parameters
indexThe promise index that succeeded.
resultThe success value of the promise

◆ ReportEntrySuccess() [2/2]

void Beamable.Common.SequencePromise< T >.ReportEntrySuccess ( SequenceEntrySuccess< T >  success)
inline

When a promise has succeeded, report the success. All promises must report success for the entire sequence promise to succeed.

Parameters
successThe SequenceEntrySuccess<T> that occured

The documentation for this class was generated from the following file: