mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
After the changes introduced in https://github.com/apple/swift-nio-http2/pull/487, we need to make a small change in the implementation of `NIOAsyncChannel` to wait on the `closeFuture` instead of on `close`'s promise in the `executeThenClose` implementation. ### Motivation: `executeThenClose` shouldn't fail from errors arising from closing the channel - at this point, the user of the channel cannot really do anything, and since the channel has been closed, we should not fail since resources have been cleaned up anyways. ### Modifications: This PR changes the implementation of `NIOAsyncChannel` to wait on the `closeFuture` instead of on `close`'s promise in the `executeThenClose` implementation. It also updates the docs for `closeFuture` to better explain when it will be succeeded and why it won't ever be failed. ### Result: `executeThenClose` won't throw errors upon closing.