Skip to content

Commit

Permalink
Update Examples to use .singleton (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
chieffancypants authored May 9, 2024
1 parent a220837 commit 2fa5b34
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Examples/GetHTML/GetHTML.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import NIOCore
@main
struct GetHTML {
static func main() async throws {
let httpClient = HTTPClient(eventLoopGroupProvider: .createNew)
let httpClient = HTTPClient(eventLoopGroupProvider: .singleton)
do {
let request = HTTPClientRequest(url: "https://apple.com")
let response = try await httpClient.execute(request, timeout: .seconds(30))
Expand Down
2 changes: 1 addition & 1 deletion Examples/GetJSON/GetJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct Comic: Codable {
@main
struct GetJSON {
static func main() async throws {
let httpClient = HTTPClient(eventLoopGroupProvider: .createNew)
let httpClient = HTTPClient(eventLoopGroupProvider: .singleton)
do {
let request = HTTPClientRequest(url: "https://xkcd.com/info.0.json")
let response = try await httpClient.execute(request, timeout: .seconds(30))
Expand Down
2 changes: 1 addition & 1 deletion Examples/StreamingByteCounter/StreamingByteCounter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import NIOCore
@main
struct StreamingByteCounter {
static func main() async throws {
let httpClient = HTTPClient(eventLoopGroupProvider: .createNew)
let httpClient = HTTPClient(eventLoopGroupProvider: .singleton)
do {
let request = HTTPClientRequest(url: "https://apple.com")
let response = try await httpClient.execute(request, timeout: .seconds(30))
Expand Down

0 comments on commit 2fa5b34

Please sign in to comment.