File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import NIOCore
1818@main
1919struct GetHTML {
2020 static func main( ) async throws {
21- let httpClient = HTTPClient ( eventLoopGroupProvider: . createNew )
21+ let httpClient = HTTPClient ( eventLoopGroupProvider: . singleton )
2222 do {
2323 let request = HTTPClientRequest ( url: " https://apple.com " )
2424 let response = try await httpClient. execute ( request, timeout: . seconds( 30 ) )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ struct Comic: Codable {
3333@main
3434struct GetJSON {
3535 static func main( ) async throws {
36- let httpClient = HTTPClient ( eventLoopGroupProvider: . createNew )
36+ let httpClient = HTTPClient ( eventLoopGroupProvider: . singleton )
3737 do {
3838 let request = HTTPClientRequest ( url: " https://xkcd.com/info.0.json " )
3939 let response = try await httpClient. execute ( request, timeout: . seconds( 30 ) )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import NIOCore
1818@main
1919struct StreamingByteCounter {
2020 static func main( ) async throws {
21- let httpClient = HTTPClient ( eventLoopGroupProvider: . createNew )
21+ let httpClient = HTTPClient ( eventLoopGroupProvider: . singleton )
2222 do {
2323 let request = HTTPClientRequest ( url: " https://apple.com " )
2424 let response = try await httpClient. execute ( request, timeout: . seconds( 30 ) )
You can’t perform that action at this time.
0 commit comments