summaryrefslogtreecommitdiffhomepage
path: root/ios/Operations/AsyncOperationQueue.swift
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2023-04-13 11:37:22 +0200
committerAndrej Mihajlov <and@mullvad.net>2023-04-14 13:05:07 +0200
commitaa59ff49063bce28bab26f57082f909cc6b7fe8b (patch)
tree86676a794521b58b232b76a0869deef5a5c876f1 /ios/Operations/AsyncOperationQueue.swift
parent09ca3b13667b4ea6562d5520aa47913d8b60ceb2 (diff)
downloadmullvadvpn-aa59ff49063bce28bab26f57082f909cc6b7fe8b.tar.xz
mullvadvpn-aa59ff49063bce28bab26f57082f909cc6b7fe8b.zip
AsyncOperation: add shortcuts for cancellation and completion events observation
Diffstat (limited to 'ios/Operations/AsyncOperationQueue.swift')
-rw-r--r--ios/Operations/AsyncOperationQueue.swift6
1 files changed, 2 insertions, 4 deletions
diff --git a/ios/Operations/AsyncOperationQueue.swift b/ios/Operations/AsyncOperationQueue.swift
index 4579546084..d1269a8175 100644
--- a/ios/Operations/AsyncOperationQueue.swift
+++ b/ios/Operations/AsyncOperationQueue.swift
@@ -73,11 +73,9 @@ private final class ExclusivityManager {
operationsByCategory[category] = operations
- let blockObserver = OperationBlockObserver(didFinish: { [weak self] op, error in
+ operation.onFinish { [weak self] op, error in
self?.removeOperation(op, categories: categories)
- })
-
- operation.addObserver(blockObserver)
+ }
}
}