Skip to content

Commit bbf7966

Browse files
authored
nest timeout configuration type inside configuration (#93)
* nest timeout configuration type inside configuration * move timeout to an extension
1 parent 5156eb2 commit bbf7966

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/AsyncHTTPClient/HTTPClient.swift

+2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ public class HTTPClient {
365365
return EventLoopPreference(.prefers(eventLoop))
366366
}
367367
}
368+
}
368369

370+
extension HTTPClient.Configuration {
369371
/// Timeout configuration
370372
public struct Timeout {
371373
/// Specifies connect timeout.

Tests/AsyncHTTPClientTests/HTTPClientTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class HTTPClientTests: XCTestCase {
239239

240240
func testReadTimeout() throws {
241241
let httpBin = HttpBin()
242-
let httpClient = HTTPClient(eventLoopGroupProvider: .createNew, configuration: HTTPClient.Configuration(timeout: HTTPClient.Timeout(read: .milliseconds(150))))
242+
let httpClient = HTTPClient(eventLoopGroupProvider: .createNew, configuration: HTTPClient.Configuration(timeout: HTTPClient.Configuration.Timeout(read: .milliseconds(150))))
243243

244244
defer {
245245
try! httpClient.syncShutdown()

0 commit comments

Comments
 (0)