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. /// - writer: A ``FileHandleWriter`` to write the response to.
/// - Return value: /// - Return value:
/// - Boolean if data could be read /// - 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") logger.debug("Agent handling new data")
let data = Data(reader.availableData) let data = Data(reader.availableData)
guard data.count > 4 else { return false} guard data.count > 4 else { return false}

View File

@ -1,7 +1,7 @@
import Foundation import Foundation
/// Protocol abstraction of the reading aspects of FileHandle. /// Protocol abstraction of the reading aspects of FileHandle.
public protocol FileHandleReader { public protocol FileHandleReader: Sendable {
/// Gets data that is available for reading. /// Gets data that is available for reading.
var availableData: Data { get } var availableData: Data { get }
@ -13,7 +13,7 @@ public protocol FileHandleReader {
} }
/// Protocol abstraction of the writing aspects of FileHandle. /// Protocol abstraction of the writing aspects of FileHandle.
public protocol FileHandleWriter { public protocol FileHandleWriter: Sendable {
/// Writes data to the handle. /// Writes data to the handle.
func write(_ data: Data) func write(_ data: Data)