aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc
diff options
context:
space:
mode:
Diffstat (limited to 'src/objc')
-rw-r--r--src/objc/utils/MCOOperation.h11
-rw-r--r--src/objc/utils/MCOOperation.mm2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/objc/utils/MCOOperation.h b/src/objc/utils/MCOOperation.h
index 3f6b42c5..08e74d84 100644
--- a/src/objc/utils/MCOOperation.h
+++ b/src/objc/utils/MCOOperation.h
@@ -14,15 +14,20 @@
@interface MCOOperation : NSObject
+/** Returns whether the operation is cancelled.*/
@property (readonly) BOOL isCancelled;
-// This methods is called on the main thread when the asynchronous operation is finished.
-// Needs to be overriden by subclasses.
+/** The queue this operation dispatches the callback on. Defaults to the main queue.*/
+@property (nonatomic, assign) dispatch_queue_t callbackDispatchQueue;
+
+/** This methods is called on the main thread when the asynchronous operation is finished.
+ Needs to be overriden by subclasses.*/
- (void) operationCompleted;
-// Cancel the operation.
+/** Cancel the operation.*/
- (void) cancel;
+
@end
#endif
diff --git a/src/objc/utils/MCOOperation.mm b/src/objc/utils/MCOOperation.mm
index 37146b39..7502afae 100644
--- a/src/objc/utils/MCOOperation.mm
+++ b/src/objc/utils/MCOOperation.mm
@@ -81,6 +81,8 @@ public:
return MCO_NATIVE_INSTANCE->isCancelled();
}
+MCO_OBJC_SYNTHESIZE_SCALAR(dispatch_queue_t, dispatch_queue_t, setCallbackDispatchQueue, callbackDispatchQueue);
+
- (void) cancel
{
if (_started) {