Skip to content

Commit

Permalink
Specify nonisolation in PacketTunnelActor
Browse files Browse the repository at this point in the history
  • Loading branch information
buggmagnet committed Aug 19, 2024
1 parent 2b37ca7 commit 48691d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ extension PacketTunnelActor {
`NEPacketTunnelProvider` provides the corresponding lifecycle method.
*/
public nonisolated func onWake() {
Task {
await tunnelMonitor.onWake()
}
tunnelMonitor.onWake()
}

/**
Expand All @@ -26,8 +24,6 @@ extension PacketTunnelActor {
`NEPacketTunnelProvider` provides the corresponding lifecycle method.
*/
public nonisolated func onSleep() {
Task {
await tunnelMonitor.onSleep()
}
tunnelMonitor.onSleep()
}
}
6 changes: 3 additions & 3 deletions ios/PacketTunnelCore/Actor/PacketTunnelActor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public actor PacketTunnelActor {

@Published internal(set) public var observedState: ObservedState = .initial

let logger = Logger(label: "PacketTunnelActor")
nonisolated let logger = Logger(label: "PacketTunnelActor")

let timings: PacketTunnelActorTimings
let tunnelAdapter: TunnelAdapterProtocol
let tunnelMonitor: TunnelMonitorProtocol
nonisolated let tunnelMonitor: TunnelMonitorProtocol
let defaultPathObserver: DefaultPathObserverProtocol
let blockedStateErrorMapper: BlockedStateErrorMapperProtocol
public let relaySelector: RelaySelectorProtocol
Expand Down Expand Up @@ -87,7 +87,7 @@ public actor PacketTunnelActor {
for await event in channel {
guard let self else { return }

await self.logger.debug("Received event: \(event.logFormat())")
self.logger.debug("Received event: \(event.logFormat())")

let effects = await self.runReducer(event)

Expand Down

0 comments on commit 48691d3

Please sign in to comment.