-
Notifications
You must be signed in to change notification settings - Fork 1
/
NSOperationQueue+JPHAsync.h
35 lines (26 loc) · 1.03 KB
/
NSOperationQueue+JPHAsync.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// NSOperationQueue+JPHAsync.h
// JPHAsyncOperation
//
// Created by Pierre Houston on 2015-06-19.
// Copyright © 2015 Pierre Houston. All rights reserved.
//
@import Foundation;
#import "JPHAsyncOperation.h"
@interface NSOperationQueue (JPHAsync)
// addAyncOperationWithBlock starts an async operation on the receiver queue.
// The block takes a parameter, the operation itself, and when the block's
// asynchronous work is done, the operation's finish method must be called.
//
// example:
// [queue addAyncOperationWithBlock:^(JPHAsyncOperation *op) {
// [something asyncWithCompletion:^{
// [op finish]
// }];
// }];
//
- (void)addAyncOperationWithBlock:(JPHAsyncOperationBlock)block;
- (void)addAyncOperationNamed:(NSString *)named withBlock:(JPHAsyncOperationBlock)block;
- (void)addAyncOperationWithDependancies:(NSArray *)dependencies block:(JPHAsyncOperationBlock)block;
- (void)addAyncOperationNamed:(NSString *)name withDependancies:(NSArray *)dependencies block:(JPHAsyncOperationBlock)block;
@end