From 9a737fe0df0ad5e74231cab9d81d20ecc60d294b Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Mon, 11 Dec 2023 00:47:47 -0800 Subject: [PATCH] Sendable. --- Sources/Packages/Sources/SecretAgentKit/Agent.swift | 2 +- .../Packages/Sources/SecretAgentKit/FileHandleProtocols.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Packages/Sources/SecretAgentKit/Agent.swift b/Sources/Packages/Sources/SecretAgentKit/Agent.swift index f4d5472..abee4dd 100644 --- a/Sources/Packages/Sources/SecretAgentKit/Agent.swift +++ b/Sources/Packages/Sources/SecretAgentKit/Agent.swift @@ -35,7 +35,7 @@ extension Agent { /// - writer: A ``FileHandleWriter`` to write the response to. /// - Return value: /// - Boolean if data could be read - @discardableResult public func handle(reader: FileHandleReader, writer: FileHandleWriter) async -> Bool { + @discardableResult @Sendable public func handle(reader: FileHandleReader, writer: FileHandleWriter) async -> Bool { logger.debug("Agent handling new data") let data = Data(reader.availableData) guard data.count > 4 else { return false} diff --git a/Sources/Packages/Sources/SecretAgentKit/FileHandleProtocols.swift b/Sources/Packages/Sources/SecretAgentKit/FileHandleProtocols.swift index c5035a0..40a2840 100644 --- a/Sources/Packages/Sources/SecretAgentKit/FileHandleProtocols.swift +++ b/Sources/Packages/Sources/SecretAgentKit/FileHandleProtocols.swift @@ -1,7 +1,7 @@ import Foundation /// Protocol abstraction of the reading aspects of FileHandle. -public protocol FileHandleReader { +public protocol FileHandleReader: Sendable { /// Gets data that is available for reading. var availableData: Data { get } @@ -13,7 +13,7 @@ public protocol FileHandleReader { } /// Protocol abstraction of the writing aspects of FileHandle. -public protocol FileHandleWriter { +public protocol FileHandleWriter: Sendable { /// Writes data to the handle. func write(_ data: Data)