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.
This commit is contained in:
@@ -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(_:))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user