Skip to content

Commit

Permalink
Use non-deprecated API for removing handlers (#125)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
glbrntt authored Aug 17, 2021
1 parent 39587bc commit 5fd5ba4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOTransportServices/StateManagedChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand Down

0 comments on commit 5fd5ba4

Please sign in to comment.