Remove unchecked sendable (#617)

This commit is contained in:
Max Goedjen 2025-08-19 23:32:46 -07:00 committed by GitHub
parent d36537b919
commit e86aa559a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 14 deletions

View File

@ -1,11 +0,0 @@
import Foundation
struct UncheckedSendable<T>: @unchecked Sendable {
let value: T
init(_ value: T) {
self.value = value
}
}

View File

@ -82,12 +82,12 @@ public final class SocketController {
logger.debug("Socket controller has new data available")
guard let new = notification.object as? FileHandle else { return }
logger.debug("Socket controller received new file handle")
Task { [handler, logger = UncheckedSendable(logger)] in
Task { [handler, logger = logger] in
if((await handler?(new, new)) == true) {
logger.value.debug("Socket controller handled data, wait for more data")
logger.debug("Socket controller handled data, wait for more data")
await new.waitForDataInBackgroundAndNotifyOnMainActor()
} else {
logger.value.debug("Socket controller called with empty data, socked closed")
logger.debug("Socket controller called with empty data, socked closed")
}
}
}