TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Min Kim.
Asynchronous execution block with timeout support
Source code for the SDK is available on GitHub
$ git clone [email protected]:ifactorylab/IFTimeoutBlock.git
Create a Podfile if not exist, add the line below
pod 'IFTimeoutBlock', '~> 1.0.0'
#import "IFTimeoutBlock.h"
IFTimeoutBlock *block = [[IFTimeoutBlock alloc] init];
IFTimeoutHandler timeoutBlock = ^(IFTimeoutBlock *block) {
// do something to notify timeout.....
};
IFExecutionBlock executionBlock = ^(IFTimeoutBlock *block) {
// send signal to the module to stop timeout timer
[block signal];
// If timedout, block.timedOut should be true
XCTAssertFalse(block.timedOut);
};
[block setExecuteAsyncWithTimeout:2 // timeout in seconds
WithHandler:timeoutBlock
andExecutionBlock:executionBlock];
[block release];