Skip to content

Commit 51cc9e7

Browse files
authored
feat(swift6): Add @Concurrent annotation (#33)
1 parent e62a7d9 commit 51cc9e7

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

Sources/SimpleHTTP/Session/Session.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public class Session {
4141
///
4242
/// The request is validated and decoded appropriately on success.
4343
/// - Returns: a async Output on success, an error otherwise
44+
@concurrent
4445
public func response<Output: Decodable>(for request: Request<Output>) async throws -> Output {
4546
let result = try await dataPublisher(for: request)
4647

@@ -62,6 +63,7 @@ public class Session {
6263
}
6364

6465
/// Perform asynchronously `request` which has no return value
66+
@concurrent
6567
public func response(for request: Request<Void>) async throws {
6668
let result = try await dataPublisher(for: request)
6769
log(.success(()), for: result.request)

Sources/SimpleHTTP/Session/SessionConfiguration.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import Foundation
44
public struct SessionConfiguration {
55
/// data encoders/decoders configuration per content type
66
let data: ContentDataCodersConfiguration
7-
/// queue on which to decode data
8-
let decodingQueue: DispatchQueue
97
/// an interceptor to apply custom behavior on the session requests/responses.
108
/// To apply multiple interceptors use `ComposeInterceptor`
119
let interceptor: Interceptor
@@ -17,21 +15,18 @@ public struct SessionConfiguration {
1715
/// - Parameter interceptors: interceptor list to apply on the session requests/responses
1816
public init(
1917
data: ContentDataCodersConfiguration = .init(),
20-
decodingQueue: DispatchQueue = .main,
2118
interceptors: CompositeInterceptor = []) {
2219
self.data = data
23-
self.decodingQueue = decodingQueue
2420
self.interceptor = interceptors
2521
}
2622

2723
/// - Parameter dataError: Error type to use when having error with data
2824
public init<DataError: Error & Decodable>(
2925
data: ContentDataCodersConfiguration,
30-
decodingQueue: DispatchQueue = .main,
3126
interceptors: CompositeInterceptor = [],
3227
dataError: DataError.Type
3328
) {
34-
self.init(data: data, decodingQueue: decodingQueue, interceptors: interceptors)
29+
self.init(data: data, interceptors: interceptors)
3530
self.errorConverter = { [decoders=data.decoders] data, contentType in
3631
guard let decoder = decoders[contentType] else {
3732
throw SessionConfigurationError.missingDecoder(contentType)

0 commit comments

Comments
 (0)