mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-03-29 06:59:46 +08:00
30 lines
482 B
Swift
30 lines
482 B
Swift
//
|
|
// QueueFactory.swift
|
|
// ProxyPin
|
|
//
|
|
// Created by wanghongen on 2024/9/17.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class QueueFactory {
|
|
static let instance = QueueFactory()
|
|
|
|
private let queue: DispatchQueue
|
|
|
|
private init() {
|
|
queue = DispatchQueue(label: "com.network.ProxyPin.queue")
|
|
}
|
|
|
|
func getQueue() -> DispatchQueue {
|
|
return queue
|
|
}
|
|
|
|
func executeAsync(block: @escaping () -> Void) {
|
|
queue.async {
|
|
block()
|
|
}
|
|
}
|
|
|
|
}
|