FMLiveSwitchPromiseBase Class Reference

Promise base properties/methods. More...

Instance Methods

(bool) - castAndResolveWithResult:
 Casts the result and resolves the promise. More...
 
(void) - doAllWithPromises:counter:
 Internal DoAll. More...
 
(void) - doAnyWithPromises:resolveCount:rejectCounter:
 Internal DoAny. More...
 
(NSString *) - id
 Gets the identifier of this promise. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchPromiseBase`1 class. More...
 
(void) - processWithPromise:resolve:reject:
 Processes the specified promise. More...
 
(void) - processWithPromise:resolveBlock:rejectBlock:
 Processes the specified promise. More...
 
(NSException *) - processWithPromiseAndResolveBlockAndRejectBlock
 Processes the specified promise. More...
 
(FMLiveSwitchFuture< id > *) - rejectAsyncWithException:
 Rejects the promise asynchronously. More...
 
(bool) - rejectWithException:
 Rejects the promise. More...
 
(FMLiveSwitchFuture< id > *) - resolveAsyncWithResult:
 Resolves the promise asynchronously. More...
 
(bool) - resolveWithResult:
 Resolves the promise. More...
 

Class Methods

(FMLiveSwitchFuture< id > *) + anyWithPromises:
 Returns a promise that resolves when any passed in promise resolves. More...
 
(FMLiveSwitchFuture< id > *) + delayWithDelayMs:
 Create a promise that resolves afer a delay. More...
 
(FMLiveSwitchPromiseBase *) + promiseBase
 Initializes a new instance of the FMLiveSwitchPromiseBase`1 class. More...
 
(FMLiveSwitchFuture< id > *) + rejectNowWithEx:
 Creates a promise and rejects it immediately. More...
 
(FMLiveSwitchFuture< id > *) + resolveNow
 Creates a promise and resolves it immediately using a null result value. More...
 
(FMLiveSwitchFuture< id > *) + resolveNowWithResult:
 Creates a promise and resolves it immediately using the given result value. More...
 
(FMLiveSwitchFuture< id > *) + wrapPromiseWithCallback:
 Creates a promise and resolves it using the result from a callback function, or rejects it if an exception is thrown. More...
 
(void) + wrapPromiseWithCallbackBlock
 Creates a promise and resolves it using the result from a callback function, or rejects it if an exception is thrown. More...
 
(FMLiveSwitchFuture< id > *) + wrapPromiseWithCallbackBlock:
 Creates a promise and resolves it using the result from a callback function, or rejects it if an exception is thrown. More...
 

Protected Attributes

 __pad0__: FMLiveSwitchFuture<T><FMLiveSwitchIPromise>+ (FMLiveSwitchFuture<id>*) allWithPromises:(NSMutableArray*)promises
 

Detailed Description

Promise base properties/methods.

Method Documentation

◆ anyWithPromises:

+ (FMLiveSwitchFuture<id>*) anyWithPromises: (NSMutableArray *)  promises

Returns a promise that resolves when any passed in promise resolves.

Parameters
promisesThe promises to check.

◆ castAndResolveWithResult:

- (bool) castAndResolveWithResult: (id result

Casts the result and resolves the promise.

Will throw an exception if the cast fails.

Parameters
resultThe result.

◆ delayWithDelayMs:

+ (FMLiveSwitchFuture<id>*) delayWithDelayMs: (int)  delayMs

Create a promise that resolves afer a delay.

Parameters
delayMs

◆ doAllWithPromises:counter:

- (void) doAllWithPromises: (NSMutableArray *)  promises
counter: (FMLiveSwitchAtomicInteger *)  counter 

Internal DoAll.

◆ doAnyWithPromises:resolveCount:rejectCounter:

- (void) doAnyWithPromises: (NSMutableArray *)  promises
resolveCount: (FMLiveSwitchAtomicInteger *)  resolveCount
rejectCounter: (FMLiveSwitchAtomicInteger *)  rejectCounter 

Internal DoAny.

Parameters
promises
resolveCount
rejectCounter

◆ id

- (NSString*) id

Gets the identifier of this promise.

◆ init

- (instancetype) init

Initializes a new instance of the FMLiveSwitchPromiseBase`1 class.

◆ processWithPromise:resolve:reject:

- (void) processWithPromise: (NSObject< FMLiveSwitchIPromise > *)  promise
resolve: (FMLiveSwitchAction1< T > *)  resolve
reject: (FMLiveSwitchAction1< NSException * > *)  reject 

Processes the specified promise.

Parameters
promiseThe promise.
resolveThe resolve.
rejectThe reject.

◆ processWithPromise:resolveBlock:rejectBlock:

- (void) processWithPromise: (NSObject< FMLiveSwitchIPromise > *)  promise
resolveBlock: (void(^)(T))  resolveBlock
rejectBlock: (void(^)(NSException *))  rejectBlock 

Processes the specified promise.

Parameters
promiseThe promise.
resolveBlockThe resolve.
rejectBlockThe reject.

◆ processWithPromiseAndResolveBlockAndRejectBlock

- (NSException*) processWithPromiseAndResolveBlockAndRejectBlock

Processes the specified promise.

@inlineparam promise The promise. @inlineparam resolveBlock The resolve. @inlineparam rejectBlock The reject.

◆ promiseBase

+ (FMLiveSwitchPromiseBase*) promiseBase

Initializes a new instance of the FMLiveSwitchPromiseBase`1 class.

◆ rejectAsyncWithException:

- (FMLiveSwitchFuture<id>*) rejectAsyncWithException: (NSException *)  exception

Rejects the promise asynchronously.

Parameters
exceptionThe exception.

◆ rejectNowWithEx:

+ (FMLiveSwitchFuture<id>*) rejectNowWithEx: (NSException *)  ex

Creates a promise and rejects it immediately.

Parameters
exThe exception.

◆ rejectWithException:

- (bool) rejectWithException: (NSException *)  exception

Rejects the promise.

Parameters
exceptionThe exception.

◆ resolveAsyncWithResult:

- (FMLiveSwitchFuture<id>*) resolveAsyncWithResult: (T)  result

Resolves the promise asynchronously.

Parameters
resultThe result.

◆ resolveNow

+ (FMLiveSwitchFuture<id>*) resolveNow

Creates a promise and resolves it immediately using a null result value.

◆ resolveNowWithResult:

+ (FMLiveSwitchFuture<id>*) resolveNowWithResult: (id result

Creates a promise and resolves it immediately using the given result value.

Parameters
resultThe result.

◆ resolveWithResult:

- (bool) resolveWithResult: (T)  result

Resolves the promise.

Parameters
resultThe result.

◆ wrapPromiseWithCallback:

+ (FMLiveSwitchFuture<id>*) wrapPromiseWithCallback: (FMLiveSwitchFunction0< FMLiveSwitchFuture< id > * > *)  callback

Creates a promise and resolves it using the result from a callback function, or rejects it if an exception is thrown.

Parameters
callbackThe callback function.

◆ wrapPromiseWithCallbackBlock

+ (void) wrapPromiseWithCallbackBlock

Creates a promise and resolves it using the result from a callback function, or rejects it if an exception is thrown.

@inlineparam callbackBlock The callback function.

◆ wrapPromiseWithCallbackBlock:

+ (FMLiveSwitchFuture<id>*) wrapPromiseWithCallbackBlock: (FMLiveSwitchFuture< id > *(^)(void))  callbackBlock

Creates a promise and resolves it using the result from a callback function, or rejects it if an exception is thrown.

Parameters
callbackBlockThe callback function.

Member Data Documentation

◆ __pad0__

- __pad0__
protected