From 4a436dc821d9030de9c5b91e2d7e00089d3d5cb1 Mon Sep 17 00:00:00 2001 From: Alsey Coleman Miller Date: Sun, 24 Apr 2022 19:07:20 -0700 Subject: [PATCH] Changed `L2CAPSocket` from Class to Actor --- Sources/BluetoothLinux/L2CAP/L2CAPSocket.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/BluetoothLinux/L2CAP/L2CAPSocket.swift b/Sources/BluetoothLinux/L2CAP/L2CAPSocket.swift index f24295f..b0b9415 100755 --- a/Sources/BluetoothLinux/L2CAP/L2CAPSocket.swift +++ b/Sources/BluetoothLinux/L2CAP/L2CAPSocket.swift @@ -14,7 +14,7 @@ import SystemPackage import Socket /// L2CAP Bluetooth socket -public final class L2CAPSocket: Bluetooth.L2CAPSocket { +public actor L2CAPSocket: Bluetooth.L2CAPSocket { // MARK: - Properties @@ -25,7 +25,7 @@ public final class L2CAPSocket: Bluetooth.L2CAPSocket { /// L2CAP Socket address public let address: BluetoothAddress - public lazy var event: L2CAPSocketEventStream = { [unowned self] in + public nonisolated var event: L2CAPSocketEventStream { let stream = self.socket.event var iterator = stream.makeAsyncIterator() return L2CAPSocketEventStream(unfolding: { @@ -33,7 +33,7 @@ public final class L2CAPSocket: Bluetooth.L2CAPSocket { .next() .map { L2CAPSocketEvent($0) } }) - }() + } // MARK: - Initialization