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 | |
Promise base properties/methods.
+ (FMLiveSwitchFuture<id>*) anyWithPromises: | (NSMutableArray *) | promises |
Returns a promise that resolves when any passed in promise resolves.
promises | The promises to check. |
- (bool) castAndResolveWithResult: | (id) | result |
Casts the result and resolves the promise.
Will throw an exception if the cast fails.
result | The result. |
+ (FMLiveSwitchFuture<id>*) delayWithDelayMs: | (int) | delayMs |
Create a promise that resolves afer a delay.
delayMs |
- (void) doAllWithPromises: | (NSMutableArray *) | promises | |
counter: | (FMLiveSwitchAtomicInteger *) | counter | |
Internal DoAll.
- (void) doAnyWithPromises: | (NSMutableArray *) | promises | |
resolveCount: | (FMLiveSwitchAtomicInteger *) | resolveCount | |
rejectCounter: | (FMLiveSwitchAtomicInteger *) | rejectCounter | |
Internal DoAny.
promises | |
resolveCount | |
rejectCounter |
- (instancetype) init |
Initializes a new instance of the FMLiveSwitchPromiseBase`1 class.
- (void) processWithPromise: | (NSObject< FMLiveSwitchIPromise > *) | promise | |
resolve: | (FMLiveSwitchAction1< T > *) | resolve | |
reject: | (FMLiveSwitchAction1< NSException * > *) | reject | |
Processes the specified promise.
promise | The promise. |
resolve | The resolve. |
reject | The reject. |
- (void) processWithPromise: | (NSObject< FMLiveSwitchIPromise > *) | promise | |
resolveBlock: | (void(^)(T)) | resolveBlock | |
rejectBlock: | (void(^)(NSException *)) | rejectBlock | |
Processes the specified promise.
promise | The promise. |
resolveBlock | The resolve. |
rejectBlock | The reject. |
- (NSException*) processWithPromiseAndResolveBlockAndRejectBlock |
Processes the specified promise.
@inlineparam promise The promise. @inlineparam resolveBlock The resolve. @inlineparam rejectBlock The reject.
+ (FMLiveSwitchPromiseBase*) promiseBase |
Initializes a new instance of the FMLiveSwitchPromiseBase`1 class.
- (FMLiveSwitchFuture<id>*) rejectAsyncWithException: | (NSException *) | exception |
Rejects the promise asynchronously.
exception | The exception. |
+ (FMLiveSwitchFuture<id>*) rejectNowWithEx: | (NSException *) | ex |
Creates a promise and rejects it immediately.
ex | The exception. |
- (bool) rejectWithException: | (NSException *) | exception |
Rejects the promise.
exception | The exception. |
- (FMLiveSwitchFuture<id>*) resolveAsyncWithResult: | (T) | result |
Resolves the promise asynchronously.
result | The result. |
+ (FMLiveSwitchFuture<id>*) resolveNow |
Creates a promise and resolves it immediately using a null result value.
+ (FMLiveSwitchFuture<id>*) resolveNowWithResult: | (id) | result |
Creates a promise and resolves it immediately using the given result value.
result | The result. |
- (bool) resolveWithResult: | (T) | result |
Resolves the promise.
result | The result. |
+ (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.
callback | The callback function. |
+ (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.
+ (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.
callbackBlock | The callback function. |
|
protected |