@@ -17,10 +17,10 @@ public final class PostgresConnection: @unchecked Sendable {
1717 /// The connection's underlying channel
1818 ///
1919 /// This should be private, but it is needed for `PostgresConnection` compatibility.
20- internal let channel : Channel
20+ internal let channel : any Channel
2121
2222 /// The underlying `EventLoop` of both the connection and its channel.
23- public var eventLoop : EventLoop {
23+ public var eventLoop : any EventLoop {
2424 return self . channel. eventLoop
2525 }
2626
@@ -48,7 +48,7 @@ public final class PostgresConnection: @unchecked Sendable {
4848
4949 private var _logger : Logger
5050
51- init ( channel: Channel , connectionID: ID , logger: Logger ) {
51+ init ( channel: any Channel , connectionID: ID , logger: Logger ) {
5252 self . channel = channel
5353 self . id = connectionID
5454 self . _logger = logger
@@ -60,7 +60,7 @@ public final class PostgresConnection: @unchecked Sendable {
6060 func start( configuration: InternalConfiguration ) -> EventLoopFuture < Void > {
6161 // 1. configure handlers
6262
63- let configureSSLCallback : ( ( Channel , PostgresChannelHandler ) throws -> ( ) ) ?
63+ let configureSSLCallback : ( ( any Channel , PostgresChannelHandler ) throws -> ( ) ) ?
6464
6565 switch configuration. tls. base {
6666 case . prefer( let context) , . require( let context) :
@@ -124,7 +124,7 @@ public final class PostgresConnection: @unchecked Sendable {
124124 /// - Returns: A SwiftNIO `EventLoopFuture` that will provide a ``PostgresConnection``
125125 /// at a later point in time.
126126 public static func connect(
127- on eventLoop: EventLoop ,
127+ on eventLoop: any EventLoop ,
128128 configuration: PostgresConnection . Configuration ,
129129 id connectionID: ID ,
130130 logger: Logger
@@ -141,7 +141,7 @@ public final class PostgresConnection: @unchecked Sendable {
141141 connectionID: ID ,
142142 configuration: PostgresConnection . InternalConfiguration ,
143143 logger: Logger ,
144- on eventLoop: EventLoop
144+ on eventLoop: any EventLoop
145145 ) -> EventLoopFuture < PostgresConnection > {
146146
147147 var mlogger = logger
@@ -156,7 +156,7 @@ public final class PostgresConnection: @unchecked Sendable {
156156 // on and the EventLoop. In addition, it eliminates all potential races between the creating
157157 // thread and the EventLoop.
158158 return eventLoop. flatSubmit { ( ) -> EventLoopFuture < PostgresConnection > in
159- let connectFuture : EventLoopFuture < Channel >
159+ let connectFuture : EventLoopFuture < any Channel >
160160
161161 switch configuration. connection {
162162 case . resolved( let address) :
@@ -190,9 +190,9 @@ public final class PostgresConnection: @unchecked Sendable {
190190 }
191191
192192 static func makeBootstrap(
193- on eventLoop: EventLoop ,
193+ on eventLoop: any EventLoop ,
194194 configuration: PostgresConnection . InternalConfiguration
195- ) -> NIOClientTCPBootstrapProtocol {
195+ ) -> any NIOClientTCPBootstrapProtocol {
196196 #if canImport(Network)
197197 if let tsBootstrap = NIOTSConnectionBootstrap ( validatingGroup: eventLoop) {
198198 return tsBootstrap. connectTimeout ( configuration. options. connectTimeout)
@@ -295,7 +295,7 @@ extension PostgresConnection {
295295 tlsConfiguration: TLSConfiguration ? = nil ,
296296 serverHostname: String ? = nil ,
297297 logger: Logger = . init( label: " codes.vapor.postgres " ) ,
298- on eventLoop: EventLoop
298+ on eventLoop: any EventLoop
299299 ) -> EventLoopFuture < PostgresConnection > {
300300 var tlsFuture : EventLoopFuture < PostgresConnection . Configuration . TLS >
301301
@@ -368,7 +368,7 @@ extension PostgresConnection {
368368 /// - logger: A logger to log background events into
369369 /// - Returns: An established ``PostgresConnection`` asynchronously that can be used to run queries.
370370 public static func connect(
371- on eventLoop: EventLoop = PostgresConnection . defaultEventLoopGroup. any ( ) ,
371+ on eventLoop: any EventLoop = PostgresConnection . defaultEventLoopGroup. any ( ) ,
372372 configuration: PostgresConnection . Configuration ,
373373 id connectionID: ID ,
374374 logger: Logger
@@ -677,7 +677,7 @@ extension PostgresConnection {
677677
678678extension PostgresConnection : PostgresDatabase {
679679 public func send(
680- _ request: PostgresRequest ,
680+ _ request: any PostgresRequest ,
681681 logger: Logger
682682 ) -> EventLoopFuture < Void > {
683683 guard let command = request as? PostgresCommands else {
@@ -832,7 +832,7 @@ extension PostgresConnection {
832832 /// Returns the default `EventLoopGroup` singleton, automatically selecting the best for the platform.
833833 ///
834834 /// This will select the concrete `EventLoopGroup` depending which platform this is running on.
835- public static var defaultEventLoopGroup : EventLoopGroup {
835+ public static var defaultEventLoopGroup : any EventLoopGroup {
836836#if canImport(Network)
837837 if #available( OSX 10 . 14 , iOS 12 . 0 , tvOS 12 . 0 , watchOS 6 . 0 , * ) {
838838 return NIOTSEventLoopGroup . singleton
0 commit comments