summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/Operations/AsyncBlockOperation.swift
blob: a26e4e249f64f5785daf41963218e6442a5999eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//
//  AsyncBlockOperation.swift
//  MullvadVPN
//
//  Created by pronebird on 06/07/2020.
//  Copyright © 2020 Mullvad VPN AB. All rights reserved.
//

import Foundation

/// Asynchronous block operation
class AsyncBlockOperation: AsyncOperation {
    private let block: ((AsyncBlockOperation) -> Void)

    init(block: @escaping (AsyncBlockOperation) -> Void) {
        self.block = block
    }

    override func main() {
        block(self)
    }
}