mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
ced4fc8947
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
38 lines
1.3 KiB
Objective-C
38 lines
1.3 KiB
Objective-C
#import <Foundation/Foundation.h>
|
|
#import "Terminable.h"
|
|
#import "CollapsingFutures.h"
|
|
#import "Operation.h"
|
|
|
|
@interface TimeUtil : NSObject
|
|
|
|
+(NSTimeInterval) time;
|
|
|
|
/// Result has type Future(TypeOfValueReturnedByFunction)
|
|
+(TOCFuture*) scheduleEvaluate:(Function)function
|
|
afterDelay:(NSTimeInterval)delay
|
|
onRunLoop:(NSRunLoop*)runLoop
|
|
unlessCancelled:(TOCCancelToken*)unlessCancelledToken;
|
|
|
|
/// Result has type Future(TypeOfValueReturnedByFunction)
|
|
+(TOCFuture*) scheduleEvaluate:(Function)function
|
|
at:(NSDate*)date
|
|
onRunLoop:(NSRunLoop*)runLoop
|
|
unlessCancelled:(TOCCancelToken*)unlessCancelledToken;
|
|
|
|
+(void) scheduleRun:(Action)action
|
|
afterDelay:(NSTimeInterval)delay
|
|
onRunLoop:(NSRunLoop*)runLoop
|
|
unlessCancelled:(TOCCancelToken*)unlessCancelledToken;
|
|
|
|
+(void) scheduleRun:(Action)action
|
|
at:(NSDate*)date
|
|
onRunLoop:(NSRunLoop*)runLoop
|
|
unlessCancelled:(TOCCancelToken*)unlessCancelledToken;
|
|
|
|
+(void) scheduleRun:(Action)action
|
|
periodically:(NSTimeInterval)interval
|
|
onRunLoop:(NSRunLoop*)runLoop
|
|
untilCancelled:(TOCCancelToken*)untilCancelledToken
|
|
andRunImmediately:(BOOL)shouldRunImmediately;
|
|
|
|
@end
|