mirror of
https://github.com/apple/swift-nio
synced 2026-11-23 04:34:23 +00:00
Motivation: GetaddrinfoResolver is blocking the calling thread for anything that uses a `ClientBootstrap`. Often, `ClientBootstrap`s are used on EventLoops which obviously creates a problem because you mustn't block EventLoops. Modifications: - Offload the `getaddrinfo` call to a `DispatchQueue`. - Keep the semantics: * only do one concurrent `getaddrinfo` call per SelectableEventLoop * prevent thread explosion on `SelectableEventLoop` Result: Less EL blocking. Co-authored-by: George Barnett <gbarnett@apple.com> Co-authored-by: Cory Benfield <lukasa@apple.com>