GeezerVison is showing github.com — Return self in subscribeState:usingBlock of STNetTaskGroup to support… · kevin-lyn/STNetTaskQueue@8d99bb2
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: STNetTaskQueue/STNetTaskGroup.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -88,7 +88,7 @@ typedef void (^STNetTaskGroupSubscriptionBlock)(STNetTaskGroup *group, NSError * |
88 | 88 | @param state STNetTaskGroupState |
89 | 89 | @param block STNetTaskGroupSubscriptionBlock |
90 | 90 | */ |
91 | | -- (void)subscribeState:(STNetTaskGroupState)state usingBlock:(STNetTaskGroupSubscriptionBlock)block; |
| 91 | +- (STNetTaskGroup *)subscribeState:(STNetTaskGroupState)state usingBlock:(STNetTaskGroupSubscriptionBlock)block; |
92 | 92 |
|
93 | 93 | /** |
94 | 94 | Start executing tasks in this group. |
|
Collapse file
Copy file name to clipboardExpand all lines: STNetTaskQueue/STNetTaskGroup.m +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -45,7 +45,7 @@ - (void)addTask:(STNetTask *)task |
45 | 45 | self.tasks = [NSArray arrayWithArray:tasks]; |
46 | 46 | } |
47 | 47 |
|
48 | | -- (void)subscribeState:(STNetTaskGroupState)state usingBlock:(STNetTaskGroupSubscriptionBlock)block |
| 48 | +- (STNetTaskGroup *)subscribeState:(STNetTaskGroupState)state usingBlock:(STNetTaskGroupSubscriptionBlock)block |
49 | 49 | { |
50 | 50 | if (!self.stateToBlock) { |
51 | 51 | self.stateToBlock = [NSMutableDictionary new]; |
@@ -56,6 +56,7 @@ - (void)subscribeState:(STNetTaskGroupState)state usingBlock:(STNetTaskGroupSubs |
56 | 56 | self.stateToBlock[@(state)] = blocks; |
57 | 57 | } |
58 | 58 | [blocks addObject:[block copy]]; |
| 59 | + return self; |
59 | 60 | } |
60 | 61 |
|
61 | 62 | - (void)notifyState:(STNetTaskGroupState)state withError:(NSError *)error |
|