session-ios/Signal/src/util/Operation.h
Craig Gidney ced4fc8947 Initial work to depend on external futures library instead of internal implementation
Still need to:
- Fix indentation
- Check for any FutureSource being returned instead of FutureSource.future
- Check for then: vs thenTry: mixups
- Check for main thread related issues
- Check for other exception catching issues
- Adjust directory layout
- Manual end-to-end testing
2014-08-20 08:08:32 -04:00

35 lines
703 B
Objective-C

#import <Foundation/Foundation.h>
#import "DataUtil.h"
#import "StringUtil.h"
#import "DictionaryUtil.h"
#import "ArrayUtil.h"
typedef void(^Action)(void);
typedef id(^Function)(void);
@interface Operation : NSObject
@property (nonatomic,readonly,copy) Action callback;
+(Operation*) operation:(Action)block;
+(void) asyncRun:(Action)action
onThread:(NSThread*)thread;
+(void) asyncRunAndWaitUntilDone:(Action)action
onThread:(NSThread*)thread;
+(void) asyncRunOnNewThread:(Action)action;
-(void)run;
-(SEL) selectorToRun;
-(void) performOnNewThread;
-(void) performOnThread:(NSThread*)thread;
-(void) performOnThreadAndWaitUntilDone:(NSThread*)thread;
@end