@@ -454,9 +454,15 @@ extension ClientConnection {
454454 /// used to add additional handlers to the pipeline and is intended for debugging.
455455 ///
456456 /// - Warning: The initializer closure may be invoked *multiple times*.
457- public var debugChannelInitializer : GRPCChannelInitializer ?
457+ #if compiler(>=5.6)
458+ @preconcurrency
459+ public var debugChannelInitializer : ( @Sendable ( Channel ) -> EventLoopFuture < Void > ) ?
460+ #else
461+ public var debugChannelInitializer : ( ( Channel ) -> EventLoopFuture < Void > ) ?
462+ #endif
458463
459464 #if canImport(NIOSSL)
465+ #if compiler(>=5.6)
460466 /// Create a `Configuration` with some pre-defined defaults. Prefer using
461467 /// `ClientConnection.secure(group:)` to build a connection secured with TLS or
462468 /// `ClientConnection.insecure(group:)` to build a plaintext connection.
@@ -480,6 +486,7 @@ extension ClientConnection {
480486 /// - Parameter debugChannelInitializer: A channel initializer will be called after gRPC has
481487 /// initialized the channel. Defaults to `nil`.
482488 @available ( * , deprecated, renamed: " default(target:eventLoopGroup:) " )
489+ @preconcurrency
483490 public init (
484491 target: ConnectionTarget ,
485492 eventLoopGroup: EventLoopGroup ,
@@ -496,7 +503,7 @@ extension ClientConnection {
496503 label: " io.grpc " ,
497504 factory: { _ in SwiftLogNoOpLogHandler ( ) }
498505 ) ,
499- debugChannelInitializer: GRPCChannelInitializer ? = nil
506+ debugChannelInitializer: ( @ Sendable ( Channel ) -> EventLoopFuture < Void > ) ? = nil
500507 ) {
501508 self . target = target
502509 self . eventLoopGroup = eventLoopGroup
@@ -512,6 +519,41 @@ extension ClientConnection {
512519 self . backgroundActivityLogger = backgroundActivityLogger
513520 self . debugChannelInitializer = debugChannelInitializer
514521 }
522+ #else
523+ @available ( * , deprecated, renamed: " default(target:eventLoopGroup:) " )
524+ public init (
525+ target: ConnectionTarget ,
526+ eventLoopGroup: EventLoopGroup ,
527+ errorDelegate: ClientErrorDelegate ? = LoggingClientErrorDelegate ( ) ,
528+ connectivityStateDelegate: ConnectivityStateDelegate ? = nil ,
529+ connectivityStateDelegateQueue: DispatchQueue ? = nil ,
530+ tls: Configuration . TLS ? = nil ,
531+ connectionBackoff: ConnectionBackoff ? = ConnectionBackoff ( ) ,
532+ connectionKeepalive: ClientConnectionKeepalive = ClientConnectionKeepalive ( ) ,
533+ connectionIdleTimeout: TimeAmount = . minutes( 30 ) ,
534+ callStartBehavior: CallStartBehavior = . waitsForConnectivity,
535+ httpTargetWindowSize: Int = 8 * 1024 * 1024 ,
536+ backgroundActivityLogger: Logger = Logger (
537+ label: " io.grpc " ,
538+ factory: { _ in SwiftLogNoOpLogHandler ( ) }
539+ ) ,
540+ debugChannelInitializer: ( ( Channel ) -> EventLoopFuture < Void > ) ? = nil
541+ ) {
542+ self . target = target
543+ self . eventLoopGroup = eventLoopGroup
544+ self . errorDelegate = errorDelegate
545+ self . connectivityStateDelegate = connectivityStateDelegate
546+ self . connectivityStateDelegateQueue = connectivityStateDelegateQueue
547+ self . tlsConfiguration = tls. map { GRPCTLSConfiguration ( transforming: $0) }
548+ self . connectionBackoff = connectionBackoff
549+ self . connectionKeepalive = connectionKeepalive
550+ self . connectionIdleTimeout = connectionIdleTimeout
551+ self . callStartBehavior = callStartBehavior
552+ self . httpTargetWindowSize = httpTargetWindowSize
553+ self . backgroundActivityLogger = backgroundActivityLogger
554+ self . debugChannelInitializer = debugChannelInitializer
555+ }
556+ #endif // compiler(>=5.6)
515557 #endif // canImport(NIOSSL)
516558
517559 private init ( eventLoopGroup: EventLoopGroup , target: ConnectionTarget ) {
0 commit comments