Skip to content

Commit 7f290f2

Browse files
authored
Rename PostgresChannelHandler (#251)
1 parent 8e341c1 commit 7f290f2

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Sources/PostgresNIO/Connection/PostgresConnection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public final class PostgresConnection {
173173
}
174174
}
175175

176-
let channelHandler = PSQLChannelHandler(
176+
let channelHandler = PostgresChannelHandler(
177177
configuration: configuration,
178178
logger: logger,
179179
configureSSLCallback: configureSSLCallback
@@ -597,7 +597,7 @@ extension PostgresConnection {
597597

598598
let listenContext = PostgresListenContext()
599599

600-
self.channel.pipeline.handler(type: PSQLChannelHandler.self).whenSuccess { handler in
600+
self.channel.pipeline.handler(type: PostgresChannelHandler.self).whenSuccess { handler in
601601
if self.notificationListeners[channel] != nil {
602602
self.notificationListeners[channel]!.append((listenContext, notificationHandler))
603603
}

Sources/PostgresNIO/New/PSQLEventsHandler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import NIOTLS
33
import Logging
44

55
enum PSQLOutgoingEvent {
6-
/// the event we send down the channel to inform the `PSQLChannelHandler` to authenticate
6+
/// the event we send down the channel to inform the ``PostgresChannelHandler`` to authenticate
77
///
88
/// this shall be removed with the next breaking change and always supplied with `PSQLConnection.Configuration`
99
case authenticate(AuthContext)
1010
}
1111

1212
enum PSQLEvent {
1313

14-
/// the event that is used to inform upstream handlers that `PSQLChannelHandler` has established a connection
14+
/// the event that is used to inform upstream handlers that ``PostgresChannelHandler`` has established a connection
1515
case readyForStartup
1616

17-
/// the event that is used to inform upstream handlers that `PSQLChannelHandler` is currently idle
17+
/// the event that is used to inform upstream handlers that ``PostgresChannelHandler`` is currently idle
1818
case readyForQuery
1919
}
2020

Sources/PostgresNIO/New/PSQLChannelHandler.swift renamed to Sources/PostgresNIO/New/PostgresChannelHandler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ protocol PSQLChannelHandlerNotificationDelegate: AnyObject {
77
func notificationReceived(_: PostgresBackendMessage.NotificationResponse)
88
}
99

10-
final class PSQLChannelHandler: ChannelDuplexHandler {
10+
final class PostgresChannelHandler: ChannelDuplexHandler {
1111
typealias OutboundIn = PSQLTask
1212
typealias InboundIn = ByteBuffer
1313
typealias OutboundOut = ByteBuffer
@@ -501,7 +501,7 @@ final class PSQLChannelHandler: ChannelDuplexHandler {
501501
}
502502
}
503503

504-
extension PSQLChannelHandler: PSQLRowsDataSource {
504+
extension PostgresChannelHandler: PSQLRowsDataSource {
505505
func request(for stream: PSQLRowStream) {
506506
guard self.rowStream === stream else {
507507
return
@@ -587,7 +587,7 @@ extension ConnectionStateMachine.TLSConfiguration {
587587
}
588588
}
589589

590-
extension PSQLChannelHandler {
590+
extension PostgresChannelHandler {
591591
convenience init(
592592
configuration: PostgresConnection.InternalConfiguration,
593593
configureSSLCallback: ((Channel) throws -> Void)?)

Tests/PostgresNIOTests/New/PSQLChannelHandlerTests.swift renamed to Tests/PostgresNIOTests/New/PostgresChannelHandlerTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import NIOSSL
55
import NIOEmbedded
66
@testable import PostgresNIO
77

8-
class PSQLChannelHandlerTests: XCTestCase {
8+
class PostgresChannelHandlerTests: XCTestCase {
99

1010
// MARK: Startup
1111

1212
func testHandlerAddedWithoutSSL() {
1313
let config = self.testConnectionConfiguration()
14-
let handler = PSQLChannelHandler(configuration: config, configureSSLCallback: nil)
14+
let handler = PostgresChannelHandler(configuration: config, configureSSLCallback: nil)
1515
let embedded = EmbeddedChannel(handlers: [
1616
ReverseByteToMessageHandler(PSQLFrontendMessageDecoder()),
1717
ReverseMessageToByteHandler(PSQLBackendMessageEncoder()),
@@ -40,7 +40,7 @@ class PSQLChannelHandlerTests: XCTestCase {
4040
var config = self.testConnectionConfiguration()
4141
XCTAssertNoThrow(config.tls = .require(try NIOSSLContext(configuration: .makeClientConfiguration())))
4242
var addSSLCallbackIsHit = false
43-
let handler = PSQLChannelHandler(configuration: config) { channel in
43+
let handler = PostgresChannelHandler(configuration: config) { channel in
4444
addSSLCallbackIsHit = true
4545
}
4646
let embedded = EmbeddedChannel(handlers: [
@@ -82,7 +82,7 @@ class PSQLChannelHandlerTests: XCTestCase {
8282
var config = self.testConnectionConfiguration()
8383
XCTAssertNoThrow(config.tls = .require(try NIOSSLContext(configuration: .makeClientConfiguration())))
8484

85-
let handler = PSQLChannelHandler(configuration: config) { channel in
85+
let handler = PostgresChannelHandler(configuration: config) { channel in
8686
XCTFail("This callback should never be exectuded")
8787
throw PSQLError.sslUnsupported
8888
}
@@ -118,7 +118,7 @@ class PSQLChannelHandlerTests: XCTestCase {
118118
database: config.authentication?.database
119119
)
120120
let state = ConnectionStateMachine(.waitingToStartAuthentication)
121-
let handler = PSQLChannelHandler(configuration: config, state: state, configureSSLCallback: nil)
121+
let handler = PostgresChannelHandler(configuration: config, state: state, configureSSLCallback: nil)
122122
let embedded = EmbeddedChannel(handlers: [
123123
ReverseByteToMessageHandler(PSQLFrontendMessageDecoder()),
124124
ReverseMessageToByteHandler(PSQLBackendMessageEncoder()),
@@ -147,7 +147,7 @@ class PSQLChannelHandlerTests: XCTestCase {
147147
database: config.authentication?.database
148148
)
149149
let state = ConnectionStateMachine(.waitingToStartAuthentication)
150-
let handler = PSQLChannelHandler(configuration: config, state: state, configureSSLCallback: nil)
150+
let handler = PostgresChannelHandler(configuration: config, state: state, configureSSLCallback: nil)
151151
let embedded = EmbeddedChannel(handlers: [
152152
ReverseByteToMessageHandler(PSQLFrontendMessageDecoder()),
153153
ReverseMessageToByteHandler(PSQLBackendMessageEncoder()),

0 commit comments

Comments
 (0)