1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 06:43:24 +03:00

Set target for all queues

This commit is contained in:
Tae Won Ha 2020-12-11 22:19:40 +01:00
parent 55fd685c43
commit 0b17d715dc
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
7 changed files with 33 additions and 15 deletions

View File

@ -236,7 +236,11 @@ public class NvimView: NSView,
// MARK: - Internal
let queue = DispatchQueue(label: String(reflecting: NvimView.self), qos: .userInteractive)
let queue = DispatchQueue(
label: String(reflecting: NvimView.self),
qos: .userInteractive,
target: .global(qos: .userInteractive)
)
let bridge: UiBridge

View File

@ -361,7 +361,8 @@ class UiBridge {
private let scheduler: SerialDispatchQueueScheduler
private let queue = DispatchQueue(
label: String(reflecting: UiBridge.self),
qos: .userInitiated
qos: .userInitiated,
target: .global(qos: .userInitiated)
)
private let disposeBag = DisposeBag()

View File

@ -45,7 +45,8 @@ public final class RxMessagePortClient {
public init(queueQos: DispatchQoS) {
self.queue = DispatchQueue(
label: "\(String(reflecting: RxMessagePortClient.self))-\(self.uuid.uuidString)",
qos: queueQos
qos: queueQos,
target: .global(qos: queueQos.qosClass)
)
}
@ -151,7 +152,8 @@ public final class RxMessagePortServer {
public init(queueQos: DispatchQoS) {
self.queue = DispatchQueue(
label: "\(String(reflecting: RxMessagePortClient.self))-\(self.uuid.uuidString)",
qos: queueQos
qos: queueQos,
target: .global(qos: queueQos.qosClass)
)
self.messageHandler = MessageHandler(subject: self.streamSubject)
}

View File

@ -58,7 +58,8 @@ public final class RxMsgpackRpc {
public init(queueQos: DispatchQoS) {
self.queue = DispatchQueue(
label: "\(String(reflecting: RxMsgpackRpc.self))-\(self.uuid.uuidString)",
qos: queueQos
qos: queueQos,
target: .global(qos: queueQos.qosClass)
)
}

View File

@ -30,7 +30,7 @@ class FileMonitor {
eventHandler(URL(fileURLWithPath: event.path))
}
)
self.monitor?.setDispatchQueue(globalFileMonitorQueue)
self.monitor?.setDispatchQueue(self.queue)
try self.monitor?.start()
self.log.info("Started monitoring \(self.urlToMonitor)")
@ -46,6 +46,9 @@ class FileMonitor {
private var monitor: EonilFSEventStream?
private let log = OSLog(subsystem: Defs.loggerSubsystem, category: Defs.LoggerCategory.service)
private let queue = DispatchQueue(
label: String(reflecting: FileMonitor.self) + "-\(UUID())",
qos: .userInitiated,
target: .global(qos: .userInitiated)
)
}
private let globalFileMonitorQueue = DispatchQueue.global(qos: .userInitiated)

View File

@ -438,7 +438,11 @@ class FuzzySearchService {
private var stop = false
private let stopLock = NSLock()
private let queue = DispatchQueue(label: "scan-score-queue", qos: .userInitiated)
private let queue = DispatchQueue(
label: "scan-score-queue",
qos: .userInitiated,
target: .global(qos: .userInitiated)
)
private let fileMonitor = FileMonitor()
private let writeContext: NSManagedObjectContext

View File

@ -13,7 +13,6 @@ import WebKit
import Workspace
private let fileSystemEventsLatency = 1.0
private let monitorDispatchQueue = DispatchQueue.global(qos: .userInitiated)
class HtmlPreviewTool: NSView, UiComponent, WKNavigationDelegate {
enum Action {
@ -32,6 +31,12 @@ class HtmlPreviewTool: NSView, UiComponent, WKNavigationDelegate {
configuration.processPool = Defs.webViewProcessPool
self.webview = WKWebView(frame: CGRect.zero, configuration: configuration)
self.queue = DispatchQueue(
label: String(reflecting: HtmlPreviewTool.self) + "-\(self.uuid)",
qos: .userInitiated,
target: .global(qos: .userInitiated)
)
super.init(frame: .zero)
self.configureForAutoLayout()
@ -72,7 +77,7 @@ class HtmlPreviewTool: NSView, UiComponent, WKNavigationDelegate {
self?.reloadWebview(with: serverUrl.payload)
}
)
self.monitor?.setDispatchQueue(monitorDispatchQueue)
self.monitor?.setDispatchQueue(self.queue)
try self.monitor?.start()
} catch {
self.log.error("Could not start file monitor for \(htmlFileUrl): \(error)")
@ -116,10 +121,8 @@ class HtmlPreviewTool: NSView, UiComponent, WKNavigationDelegate {
private var monitor: EonilFSEventStream?
private let disposeBag = DisposeBag()
private let log = OSLog(
subsystem: Defs.loggerSubsystem,
category: Defs.LoggerCategory.ui
)
private let log = OSLog(subsystem: Defs.loggerSubsystem, category: Defs.LoggerCategory.ui)
private let queue: DispatchQueue
@available(*, unavailable)
required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") }