Beamable SDK
Classes | Public Member Functions | Static Public Member Functions | List of all members
Beamable.Common.Promise< T > Class Template Reference

This class defines the Beamable Promise. More...

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

Public Member Functions

void CompleteSuccess (T val)
 
void CompleteError (Exception ex)
 
Promise< T > Then (Action< T > callback)
 
Promise< T > Error (Action< Exception > errback)
 
Promise< TU > Map< TU > (Func< T, TU > callback)
 
PromiseU FlatMap< PromiseU, U > (Func< T, PromiseU > callback, Func< PromiseU > factory)
 
Promise< TU > FlatMap< TU > (Func< T, Promise< TU >> callback)
 
GetResult ()
 
Promise< T > GetAwaiter ()
 

Static Public Member Functions

static Promise< T > Successful (T value)
 
static Promise< T > Failed (Exception err)
 
static SequencePromise< T > ObservableSequence< T > (IList< Promise< T >> promises)
 
static Promise< List< T > > Sequence< T > (IList< Promise< T >> promises)
 
static Promise< List< T > > Sequence< T > (params Promise< T >[] promises)
 
static Promise< UnitExecuteSerially< T > (List< Func< Promise< T >>> generators)
 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)
 
static SequencePromise< T > ExecuteRolling2< T > (int maxProcessSize, List< Func< Promise< T >>> generators)
 Given a list of promise generator functions, process the list, but in a rolling fasion. At any given moment, the highest number of promises running will equal maxProcessSize. As soon a promise finishes, a new promise may start. 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 Public Member Functions inherited from Beamable.Common.PromiseBase
static void SetPotentialUncaughtErrorHandler (PromiseEvent handler)
 

Additional Inherited Members

- Public Attributes inherited from Beamable.Common.PromiseBase
bool IsCompleted => done
 
- Static Public Attributes inherited from Beamable.Common.PromiseBase
static readonly Unit Unit = new Unit()
 
static Promise< UnitSuccessfulUnit => Promise<Unit>.Successful(Unit)
 
- Protected Member Functions inherited from Beamable.Common.PromiseBase
void InvokeUncaughtPromise ()
 
- Protected Attributes inherited from Beamable.Common.PromiseBase
Action< Exception > errbacks
 
Exception err
 
object _lock = new object()
 
- Properties inherited from Beamable.Common.PromiseBase
bool HadAnyErrbacks [get, protected set]
 
bool done [get, set]
 

Detailed Description

This class 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).

Related Links

img beamable-logo

Member Function Documentation

◆ ExecuteInBatch< T >()

static Promise<Unit> Beamable.Common.Promise< T >.ExecuteInBatch< T > ( int  maxBatchSize,
List< Func< Promise< T >>>  generators 
)
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.

Parameters
maxBatchSize
generators
Template Parameters
T
Returns
A single promise of Unit to represent the completion of the processing. Any other side effects need to be handled separately

◆ ExecuteRolling2< T >()

static SequencePromise<T> Beamable.Common.Promise< T >.ExecuteRolling2< T > ( int  maxProcessSize,
List< Func< Promise< T >>>  generators 
)
inlinestatic

Given a list of promise generator functions, process the list, but in a rolling fasion. At any given moment, the highest number of promises running will equal maxProcessSize. As soon a promise finishes, a new promise may start.

Parameters
maxProcessSize
generators
Template Parameters
T
Returns

◆ ExecuteSerially< T >()

static Promise<Unit> Beamable.Common.Promise< T >.ExecuteSerially< T > ( List< Func< Promise< T >>>  generators)
inlinestatic

Given a list of promise generator functions, process the whole list, but serially. Only one promise will be active at any given moment.

Parameters
generators
Template Parameters
T
Returns
A single promise of Unit to represent the completion of the processing. Any other side effects need to be handled separately

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