From da8ed3105f01ddc25612e015cf1ad6e199971004 Mon Sep 17 00:00:00 2001 From: Michael Rebello Date: Mon, 30 Jan 2023 14:14:31 -0800 Subject: [PATCH] Add `@Sendable` to HTTP unary completion closure --- Libraries/Connect/Implementation/URLSessionHTTPClient.swift | 2 +- Libraries/Connect/Interfaces/HTTPClientInterface.swift | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Libraries/Connect/Implementation/URLSessionHTTPClient.swift b/Libraries/Connect/Implementation/URLSessionHTTPClient.swift index a6edf461..86a622d0 100644 --- a/Libraries/Connect/Implementation/URLSessionHTTPClient.swift +++ b/Libraries/Connect/Implementation/URLSessionHTTPClient.swift @@ -39,7 +39,7 @@ open class URLSessionHTTPClient: NSObject, HTTPClientInterface { @discardableResult open func unary( - request: HTTPRequest, completion: @escaping (HTTPResponse) -> Void + request: HTTPRequest, completion: @Sendable @escaping (HTTPResponse) -> Void ) -> Cancelable { let urlRequest = URLRequest(httpRequest: request) let task = self.session.dataTask(with: urlRequest) { data, urlResponse, error in diff --git a/Libraries/Connect/Interfaces/HTTPClientInterface.swift b/Libraries/Connect/Interfaces/HTTPClientInterface.swift index 1f083fef..f77442d4 100644 --- a/Libraries/Connect/Interfaces/HTTPClientInterface.swift +++ b/Libraries/Connect/Interfaces/HTTPClientInterface.swift @@ -21,7 +21,8 @@ public protocol HTTPClientInterface { /// /// - returns: A type which can be used to cancel the outbound request. @discardableResult - func unary(request: HTTPRequest, completion: @escaping (HTTPResponse) -> Void) -> Cancelable + func unary(request: HTTPRequest, completion: @Sendable @escaping (HTTPResponse) -> Void) + -> Cancelable /// Initialize a new HTTP stream. ///