Skip to content

Commit 32fac04

Browse files
committed
fix review comments
1 parent f8b5705 commit 32fac04

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

Sources/AsyncHTTPClient/FileDownloadDelegate.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
9393
self.reportProgress = reportProgress
9494
}
9595

96-
public func provideSharedThreadPool(fileIOPool: NIOThreadPool) {
97-
guard self.io == nil else {
98-
// user has provided their own thread pool
99-
return
100-
}
101-
self.io = NonBlockingFileIO(threadPool: fileIOPool)
102-
}
103-
10496
public func didReceiveHead(
10597
task: HTTPClient.Task<Response>,
10698
_ head: HTTPResponseHead

Sources/AsyncHTTPClient/HTTPClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ public class HTTPClient {
7373
let configuration: Configuration
7474
let poolManager: HTTPConnectionPool.Manager
7575

76-
/// Shared thread pool used for file IO. It is given to the user through ``HTTPClientResponseDelegate/provideSharedThreadPool(fileIOPool:)-6phmu``
76+
/// Shared thread pool used for file IO. It is lazily created on first access of ``Task/fileIOThreadPool``.
7777
private var fileIOThreadPool: NIOThreadPool?
78-
private var fileIOThreadPoolLock = Lock()
78+
private let fileIOThreadPoolLock = Lock()
7979

8080
private var state: State
8181
private let stateLock = Lock()

Sources/AsyncHTTPClient/HTTPHandler.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ extension HTTPClient {
625625
private let lock = Lock()
626626
private let makeOrGetFileIOThreadPool: () -> NIOThreadPool
627627

628+
/// The shared thread pool of a ``HTTPClient`` used for file IO. It is lazily created on first access.
628629
public var fileIOThreadPool: NIOThreadPool {
629630
self.makeOrGetFileIOThreadPool()
630631
}

0 commit comments

Comments
 (0)