2 Commits
Author SHA1 Message Date
Cory BenfieldandGitHub 3b4942f5b3 Remove misuse of EmbeddedEventLoop (#812)
Motivation

EmbeddedEventLoop is not thread-safe, which means that outside of very
rare use-cases it's not safe to use it in Swift Concurrency.

Modifications

Replace invalid uses of EmbeddedEventLoop with NIOAsyncTestingEventLoop

Result

Better safety
2025-02-17 15:43:34 +00:00
89dc8d0068 baby steps towards a Structured Concurrency API (#806)
At the moment, `HTTPClient`'s entire API surface violates Structured
Concurrency. Both the creation & shutdown of a HTTP client as well as
making requests (#807) doesn't follow Structured Concurrency. Some of
the problems are:

1. Upon return of methods, resources are still in active use in other
threads/tasks
2. Cancellation doesn't always work

This PR is baby steps towards a Structured Concurrency API, starting
with start/shutdown of the HTTP client.

Co-authored-by: Johannes Weiss <johannes@jweiss.io>
2025-02-06 17:11:37 +00:00