mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation:
The `addHandler` method is useful for creating extensions to add handlers similar to what Swift NIO offers w/ HTTP. For example:
```swift
extension ChannelPipeline {
func addPostgreSQLClientHandlers(first: Bool = false) -> EventLoopFuture<Void> {
return addHandlers(PostgreSQLMessageEncoder(), PostgreSQLMessageDecoder(), first: first)
}
}
```
Result:
Array and variadic accepting `ChannelPipeline.addHandler` methods are now available when importing the NIO module.