Sendable.

This commit is contained in:
Max Goedjen 2023-12-11 00:47:47 -08:00
parent 39a2cc53dc
commit 9a737fe0df
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -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}

View File

@ -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)