1 Commits
2.1.0 ... 2.2.0

Author SHA1 Message Date
T. R. Bernstein
10943f9ce3 Make events property of Inotify nonisolated
Some checks failed
Docs / docs (push) Has been cancelled
Docs / deploy (push) Has been cancelled
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.
2026-03-23 20:15:57 +01:00

View File

@@ -6,8 +6,8 @@ public actor Inotify {
private var excludedItemNames: Set<String> = []
private var watches = InotifyWatchManager()
private var eventReader: any DispatchSourceRead
private var eventStream: AsyncStream<RawInotifyEvent>
public var events: AsyncCompactMapSequence<AsyncStream<RawInotifyEvent>, InotifyEvent> {
private nonisolated let eventStream: AsyncStream<RawInotifyEvent>
public nonisolated var events: AsyncCompactMapSequence<AsyncStream<RawInotifyEvent>, InotifyEvent> {
self.eventStream.compactMap(self.transform(_:))
}