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‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import NIOCore
1818
@main
1919
structGetHTML{
2020
staticfunc main()asyncthrows{
21-
lethttpClient=HTTPClient(eventLoopGroupProvider:.createNew)
21+
lethttpClient=HTTPClient(eventLoopGroupProvider:.singleton)
2222
do{
2323
letrequest=HTTPClientRequest(url:"https://apple.com")
2424
letresponse=tryawait httpClient.execute(request, timeout:.seconds(30))

‎Examples/GetJSON/GetJSON.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct Comic: Codable{
3333
@main
3434
structGetJSON{
3535
staticfunc main()asyncthrows{
36-
lethttpClient=HTTPClient(eventLoopGroupProvider:.createNew)
36+
lethttpClient=HTTPClient(eventLoopGroupProvider:.singleton)
3737
do{
3838
letrequest=HTTPClientRequest(url:"https://xkcd.com/info.0.json")
3939
letresponse=tryawait httpClient.execute(request, timeout:.seconds(30))

‎Examples/StreamingByteCounter/StreamingByteCounter.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import NIOCore
1818
@main
1919
structStreamingByteCounter{
2020
staticfunc main()asyncthrows{
21-
lethttpClient=HTTPClient(eventLoopGroupProvider:.createNew)
21+
lethttpClient=HTTPClient(eventLoopGroupProvider:.singleton)
2222
do{
2323
letrequest=HTTPClientRequest(url:"https://apple.com")
2424
letresponse=tryawait httpClient.execute(request, timeout:.seconds(30))

0 commit comments

Comments
(0)