Skip to content

Commit 2fa5b34

Browse files
Update Examples to use .singleton (#742)
1 parent a220837 commit 2fa5b34

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Examples/GetHTML/GetHTML.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import NIOCore
1818
@main
1919
struct 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))

Examples/GetJSON/GetJSON.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct Comic: Codable {
3333
@main
3434
struct 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))

Examples/StreamingByteCounter/StreamingByteCounter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import NIOCore
1818
@main
1919
struct 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))

0 commit comments

Comments
 (0)