File tree Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -93,14 +93,6 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
93
93
self . reportProgress = reportProgress
94
94
}
95
95
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
-
104
96
public func didReceiveHead(
105
97
task: HTTPClient . Task < Response > ,
106
98
_ head: HTTPResponseHead
Original file line number Diff line number Diff line change @@ -73,9 +73,9 @@ public class HTTPClient {
73
73
let configuration : Configuration
74
74
let poolManager : HTTPConnectionPool . Manager
75
75
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``.
77
77
private var fileIOThreadPool : NIOThreadPool ?
78
- private var fileIOThreadPoolLock = Lock ( )
78
+ private let fileIOThreadPoolLock = Lock ( )
79
79
80
80
private var state : State
81
81
private let stateLock = Lock ( )
Original file line number Diff line number Diff line change @@ -625,6 +625,7 @@ extension HTTPClient {
625
625
private let lock = Lock ( )
626
626
private let makeOrGetFileIOThreadPool : ( ) -> NIOThreadPool
627
627
628
+ /// The shared thread pool of a ``HTTPClient`` used for file IO. It is lazily created on first access.
628
629
public var fileIOThreadPool : NIOThreadPool {
629
630
self . makeOrGetFileIOThreadPool ( )
630
631
}
You can’t perform that action at this time.
0 commit comments