mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
ChannelPipeline: addHandler and removeHandler instead of add/remove (#817)
Motivation: - `ChannelPipeline.add(name:handler:...)` had a strange order of arguments - `remove(handler:)` and `remove(ctx:)` both remove `ChannelHandler`s but they read like they remove different things So let's just fix the argument order and name them `addHandler` and `removeHandler` making clear what they do. Modifications: - rename all `ChannelPipeline.add(name:handler:...)`s to `ChannelPipeline.addHandler(_:name:...)` - rename all `ChannelPipeline.remove(...)`s to `ChannelPipeline.removeHandler(...)` Result: more readable and consistent code
This commit is contained in:
1 parent
5d27e59bd9
commit
46ffd630de
50 files changed
+539
-425
No files matched your search
@@ -517,7 +517,7 @@ let bootstrap = ServerBootstrap(group: group)
|
||||
// Set the handlers that are applied to the accepted Channels
|
||||
.childChannelInitializer { channel in
|
||||
channel.pipeline.configureHTTPServerPipeline(withErrorHandling: true).flatMap {
|
||||
channel.pipeline.add(handler: HTTPHandler(fileIO: fileIO, htdocsPath: htdocs))
|
||||
channel.pipeline.addHandler(HTTPHandler(fileIO: fileIO, htdocsPath: htdocs))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user