Use non-deprecated API for removing handlers (#125)

Motivation:

`removeHandlers(channel:)` was deprecated in NIO 2.32.0.

Modifications:

- Raise minimum required NIO version to 2.32.0
- Use `removeHandlers(pipeline:)`

Result:

We don't use deprecated API.
This commit is contained in:
George Barnett 2021-08-17 18:01:25 +01:00 committed by GitHub
parent 39587bcecc
commit 5fd5ba4d3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ let package = Package(
.library(name: "NIOTransportServices", targets: ["NIOTransportServices"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.30.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
],
targets: [
.target(

View File

@ -225,7 +225,7 @@ extension StateManagedChannel {
// Now we schedule our final cleanup. We need to keep the channel pipeline alive for at least one more event
// loop tick, as more work might be using it.
self.eventLoop.execute {
self.removeHandlers(channel: self)
self.removeHandlers(pipeline: self.pipeline)
self.closePromise.succeed(())
}