File tree 3 files changed +3
-3
lines changed
3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import NIOCore
18
18
@main
19
19
struct GetHTML {
20
20
static func main( ) async throws {
21
- let httpClient = HTTPClient ( eventLoopGroupProvider: . createNew )
21
+ let httpClient = HTTPClient ( eventLoopGroupProvider: . singleton )
22
22
do {
23
23
let request = HTTPClientRequest ( url: " https://apple.com " )
24
24
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 {
33
33
@main
34
34
struct GetJSON {
35
35
static func main( ) async throws {
36
- let httpClient = HTTPClient ( eventLoopGroupProvider: . createNew )
36
+ let httpClient = HTTPClient ( eventLoopGroupProvider: . singleton )
37
37
do {
38
38
let request = HTTPClientRequest ( url: " https://xkcd.com/info.0.json " )
39
39
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
18
18
@main
19
19
struct StreamingByteCounter {
20
20
static func main( ) async throws {
21
- let httpClient = HTTPClient ( eventLoopGroupProvider: . createNew )
21
+ let httpClient = HTTPClient ( eventLoopGroupProvider: . singleton )
22
22
do {
23
23
let request = HTTPClientRequest ( url: " https://apple.com " )
24
24
let response = try await httpClient. execute ( request, timeout: . seconds( 30 ) )
You can’t perform that action at this time.
0 commit comments