From e9bf0316e2b296330dd3eeef57419cea7cda7d1d Mon Sep 17 00:00:00 2001 From: Guo Yu Date: Fri, 7 Jul 2017 09:25:14 +0800 Subject: [PATCH] Update README.md --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5303140..0d185ed 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ examples: `ScheduleTask1` will be executed right after `1448873913`(timestamp, like `[[NSDate date] timeIntervalSince1970]`), it will be executed `5` times for every `1` second. -`ScheduleTask2` will be executed every `2` second, and it will repeat `10` times . +`ScheduleTask2` will be executed every `2` seconds, and it will repeat `10` times . Schedule task has a built-in clock, time interval is 1 second. Thus the `timeinterval` in paramters should be an integral multiple of built-in time interval. Besides the maximum `timeinterval` is 120 * built-in time interval. @@ -143,10 +143,30 @@ Notification task is designed for task should be triggered by a notification. Ex ``` - #### Runtime injection +Following interfaces can be used in runtime scenario to inject `event` tasks and `schedule` tasks. + +```objc +- (void)injectEventTaskWithName:(NSString *)taskName + andBlock:(RWTaskBlock)block + priority:(RWTaskPriority)p + triggerEvent:(RWTaskEvent)e + dependency:(NSArray *)dependency + autoRemove:(BOOL)autoRemove; + +- (void)scheduleTaskWithName:(NSString *)taskName + andBlock:(RWTaskBlock)block + desiredDate:(NSDate *)date + repeatCount:(NSInteger)count + timeInterval:(NSUInteger)timeInterval; +- (void)destroyTaskByName:(NSString *)taskName; +- (void)pauseTaskByName:(NSString *)taskName; + +- (void)resumeTaskByName:(NSString *)taskName; + +```