APBBackwardCommand.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // APBBackwardCommand.h
  3. // BioAuthEngine
  4. //
  5. // Created by yukun.tyk on 11/26/15.
  6. // Copyright © 2015 DTF. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. /**
  10. * 任务队列可要求框架执行的命令
  11. */
  12. typedef NS_ENUM(NSInteger, APBBackwardCommandType) {
  13. BACKWARD_COMMAND_RESTART = 300, //重新开始任务队列,task可以设置params来指定冲新开始的任务下标
  14. BACKWARD_COMMAND_ADD_PARALLEL_TASK = 302, //添加并行任务
  15. BACKWARD_COMMNAD_GLOBAL_TIMER = 305, //全局timer操作
  16. BACKWARD_COMMNAD_UPLOAD_DATA = 400, //合并上传
  17. BACKWARD_COMMNAD_STOP_SCANCE = 401, //关闭扫描
  18. };
  19. typedef NS_ENUM(NSInteger, APBTimerCommandType) {
  20. TIMER_COMMAND_START, //开始全局计时
  21. TIMER_COMMAND_CANCEL, //取消全局计时
  22. TIMER_COMMAND_PAUSE, //暂停全局计时
  23. TIMER_COMMAND_RESUME, //恢复全局计时
  24. };
  25. /**
  26. * param key {BACKWARD_COMMAND_RESTART}
  27. * 重新开始命令,指定从第几个任务开始
  28. */
  29. extern NSString *const kCommandRestartTaskIndexKey;
  30. /**
  31. * param key {BACKWARD_COMMAND_ADD_PARALLEL_TASK}
  32. * 添加并行任务,value为id<IBioAuthTask>,新任务会在新线程中并行运行
  33. */
  34. extern NSString *const kAddParallelTaskInstanceKey;
  35. /**
  36. * 全局计时器操作命令
  37. * value为NSNumber{APBTimerCommandType}
  38. */
  39. extern NSString *const kGlobalTimerCommandKey;
  40. @interface APBBackwardCommand : NSObject
  41. @property(nonatomic, assign, readonly)APBBackwardCommandType commandType;
  42. @property(nonatomic, strong, readonly)NSDictionary *params;
  43. - (instancetype)initWithCommandType:(APBBackwardCommandType)commandType
  44. withParams:(NSDictionary *)params;
  45. @end