diff --git a/Sources/SimpleHTTP/Session/Session.swift b/Sources/SimpleHTTP/Session/Session.swift index 7710022..e6fa124 100644 --- a/Sources/SimpleHTTP/Session/Session.swift +++ b/Sources/SimpleHTTP/Session/Session.swift @@ -41,6 +41,7 @@ public class Session { /// /// The request is validated and decoded appropriately on success. /// - Returns: a async Output on success, an error otherwise + @concurrent public func response(for request: Request) async throws -> Output { let result = try await dataPublisher(for: request) @@ -62,6 +63,7 @@ public class Session { } /// Perform asynchronously `request` which has no return value + @concurrent public func response(for request: Request) async throws { let result = try await dataPublisher(for: request) log(.success(()), for: result.request) diff --git a/Sources/SimpleHTTP/Session/SessionConfiguration.swift b/Sources/SimpleHTTP/Session/SessionConfiguration.swift index 6b8e7fe..957f3de 100644 --- a/Sources/SimpleHTTP/Session/SessionConfiguration.swift +++ b/Sources/SimpleHTTP/Session/SessionConfiguration.swift @@ -4,8 +4,6 @@ import Foundation public struct SessionConfiguration { /// data encoders/decoders configuration per content type let data: ContentDataCodersConfiguration - /// queue on which to decode data - let decodingQueue: DispatchQueue /// an interceptor to apply custom behavior on the session requests/responses. /// To apply multiple interceptors use `ComposeInterceptor` let interceptor: Interceptor @@ -17,21 +15,18 @@ public struct SessionConfiguration { /// - Parameter interceptors: interceptor list to apply on the session requests/responses public init( data: ContentDataCodersConfiguration = .init(), - decodingQueue: DispatchQueue = .main, interceptors: CompositeInterceptor = []) { self.data = data - self.decodingQueue = decodingQueue self.interceptor = interceptors } /// - Parameter dataError: Error type to use when having error with data public init( data: ContentDataCodersConfiguration, - decodingQueue: DispatchQueue = .main, interceptors: CompositeInterceptor = [], dataError: DataError.Type ) { - self.init(data: data, decodingQueue: decodingQueue, interceptors: interceptors) + self.init(data: data, interceptors: interceptors) self.errorConverter = { [decoders=data.decoders] data, contentType in guard let decoder = decoders[contentType] else { throw SessionConfigurationError.missingDecoder(contentType)