From 10943f9ce328786faef1cae2f680601b33d5a5ab Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" Date: Mon, 23 Mar 2026 20:15:57 +0100 Subject: [PATCH] Make events property of Inotify nonisolated Properties of actors are implicitly isolated. To be able to read the events stream from any concurrent context, we need to declare it nonisolated. And as AsyncStream conforms to Sendable, it is safe to make both events and the private eventStream nonisolated. --- Sources/Inotify/Inotify.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Inotify/Inotify.swift b/Sources/Inotify/Inotify.swift index 4c492c8..582ad05 100644 --- a/Sources/Inotify/Inotify.swift +++ b/Sources/Inotify/Inotify.swift @@ -6,8 +6,8 @@ public actor Inotify { private var excludedItemNames: Set = [] private var watches = InotifyWatchManager() private var eventReader: any DispatchSourceRead - private var eventStream: AsyncStream - public var events: AsyncCompactMapSequence, InotifyEvent> { + private nonisolated let eventStream: AsyncStream + public nonisolated var events: AsyncCompactMapSequence, InotifyEvent> { self.eventStream.compactMap(self.transform(_:)) }