mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
25 lines
499 B
Swift
25 lines
499 B
Swift
import Foundation
|
|
|
|
final class CanvasFileWatcher: @unchecked Sendable {
|
|
private let watcher: CoalescingFSEventsWatcher
|
|
|
|
init(url: URL, onChange: @escaping () -> Void) {
|
|
self.watcher = CoalescingFSEventsWatcher(
|
|
paths: [url.path],
|
|
queueLabel: "ai.openclaw.canvaswatcher",
|
|
onChange: onChange)
|
|
}
|
|
|
|
deinit {
|
|
self.stop()
|
|
}
|
|
|
|
func start() {
|
|
self.watcher.start()
|
|
}
|
|
|
|
func stop() {
|
|
self.watcher.stop()
|
|
}
|
|
}
|