@@ -78,7 +78,8 @@ public class HTTPClient {
78
78
/// - eventLoopGroupProvider: Specify how `EventLoopGroup` will be created.
79
79
/// - configuration: Client configuration.
80
80
public convenience init ( eventLoopGroupProvider: EventLoopGroupProvider ,
81
- configuration: Configuration = Configuration ( ) ) {
81
+ configuration: Configuration = Configuration ( ) )
82
+ {
82
83
self . init ( eventLoopGroupProvider: eventLoopGroupProvider,
83
84
configuration: configuration,
84
85
backgroundActivityLogger: HTTPClient . loggingDisabled)
@@ -91,7 +92,8 @@ public class HTTPClient {
91
92
/// - configuration: Client configuration.
92
93
public required init ( eventLoopGroupProvider: EventLoopGroupProvider ,
93
94
configuration: Configuration = Configuration ( ) ,
94
- backgroundActivityLogger: Logger ) {
95
+ backgroundActivityLogger: Logger )
96
+ {
95
97
self . eventLoopGroupProvider = eventLoopGroupProvider
96
98
switch self . eventLoopGroupProvider {
97
99
case . shared( let group) :
@@ -424,7 +426,8 @@ public class HTTPClient {
424
426
public func execute( request: Request ,
425
427
eventLoop eventLoopPreference: EventLoopPreference ,
426
428
deadline: NIODeadline ? = nil ,
427
- logger: Logger ? ) -> EventLoopFuture < Response > {
429
+ logger: Logger ? ) -> EventLoopFuture < Response >
430
+ {
428
431
let accumulator = ResponseAccumulator ( request: request)
429
432
return self . execute ( request: request, delegate: accumulator, eventLoop: eventLoopPreference, deadline: deadline, logger: logger) . futureResult
430
433
}
@@ -437,7 +440,8 @@ public class HTTPClient {
437
440
/// - deadline: Point in time by which the request must complete.
438
441
public func execute< Delegate: HTTPClientResponseDelegate > ( request: Request ,
439
442
delegate: Delegate ,
440
- deadline: NIODeadline ? = nil ) -> Task < Delegate . Response > {
443
+ deadline: NIODeadline ? = nil ) -> Task < Delegate . Response >
444
+ {
441
445
return self . execute ( request: request, delegate: delegate, deadline: deadline, logger: HTTPClient . loggingDisabled)
442
446
}
443
447
@@ -451,7 +455,8 @@ public class HTTPClient {
451
455
public func execute< Delegate: HTTPClientResponseDelegate > ( request: Request ,
452
456
delegate: Delegate ,
453
457
deadline: NIODeadline ? = nil ,
454
- logger: Logger ) -> Task < Delegate . Response > {
458
+ logger: Logger ) -> Task < Delegate . Response >
459
+ {
455
460
return self . execute ( request: request, delegate: delegate, eventLoop: . indifferent, deadline: deadline, logger: logger)
456
461
}
457
462
@@ -466,7 +471,8 @@ public class HTTPClient {
466
471
public func execute< Delegate: HTTPClientResponseDelegate > ( request: Request ,
467
472
delegate: Delegate ,
468
473
eventLoop eventLoopPreference: EventLoopPreference ,
469
- deadline: NIODeadline ? = nil ) -> Task < Delegate . Response > {
474
+ deadline: NIODeadline ? = nil ) -> Task < Delegate . Response >
475
+ {
470
476
return self . execute ( request: request,
471
477
delegate: delegate,
472
478
eventLoop: eventLoopPreference,
@@ -485,7 +491,8 @@ public class HTTPClient {
485
491
delegate: Delegate ,
486
492
eventLoop eventLoopPreference: EventLoopPreference ,
487
493
deadline: NIODeadline ? = nil ,
488
- logger originalLogger: Logger ? ) -> Task < Delegate . Response > {
494
+ logger originalLogger: Logger ? ) -> Task < Delegate . Response >
495
+ {
489
496
let logger = ( originalLogger ?? HTTPClient . loggingDisabled) . attachingRequestInformation ( request, requestID: globalRequestID. add ( 1 ) )
490
497
let taskEL : EventLoop
491
498
switch eventLoopPreference. preference {
@@ -666,7 +673,8 @@ public class HTTPClient {
666
673
connectionPool: ConnectionPool = ConnectionPool ( ) ,
667
674
proxy: Proxy ? = nil ,
668
675
ignoreUncleanSSLShutdown: Bool = false ,
669
- decompression: Decompression = . disabled) {
676
+ decompression: Decompression = . disabled)
677
+ {
670
678
self . tlsConfiguration = tlsConfiguration
671
679
self . redirectConfiguration = redirectConfiguration ?? RedirectConfiguration ( )
672
680
self . timeout = timeout
@@ -681,7 +689,8 @@ public class HTTPClient {
681
689
timeout: Timeout = Timeout ( ) ,
682
690
proxy: Proxy ? = nil ,
683
691
ignoreUncleanSSLShutdown: Bool = false ,
684
- decompression: Decompression = . disabled) {
692
+ decompression: Decompression = . disabled)
693
+ {
685
694
self . init (
686
695
tlsConfiguration: tlsConfiguration,
687
696
redirectConfiguration: redirectConfiguration,
@@ -699,7 +708,8 @@ public class HTTPClient {
699
708
maximumAllowedIdleTimeInConnectionPool: TimeAmount = . seconds( 60 ) ,
700
709
proxy: Proxy ? = nil ,
701
710
ignoreUncleanSSLShutdown: Bool = false ,
702
- decompression: Decompression = . disabled) {
711
+ decompression: Decompression = . disabled)
712
+ {
703
713
self . init ( tlsConfiguration: TLSConfiguration . forClient ( certificateVerification: certificateVerification) ,
704
714
redirectConfiguration: redirectConfiguration,
705
715
timeout: timeout,
@@ -716,7 +726,8 @@ public class HTTPClient {
716
726
proxy: Proxy ? = nil ,
717
727
ignoreUncleanSSLShutdown: Bool = false ,
718
728
decompression: Decompression = . disabled,
719
- backgroundActivityLogger: Logger ? ) {
729
+ backgroundActivityLogger: Logger ? )
730
+ {
720
731
self . init ( tlsConfiguration: TLSConfiguration . forClient ( certificateVerification: certificateVerification) ,
721
732
redirectConfiguration: redirectConfiguration,
722
733
timeout: timeout,
@@ -731,7 +742,8 @@ public class HTTPClient {
731
742
timeout: Timeout = Timeout ( ) ,
732
743
proxy: Proxy ? = nil ,
733
744
ignoreUncleanSSLShutdown: Bool = false ,
734
- decompression: Decompression = . disabled) {
745
+ decompression: Decompression = . disabled)
746
+ {
735
747
self . init (
736
748
certificateVerification: certificateVerification,
737
749
redirectConfiguration: redirectConfiguration,
@@ -820,9 +832,9 @@ public class HTTPClient {
820
832
}
821
833
}
822
834
823
- extension HTTPClient . Configuration {
835
+ public extension HTTPClient . Configuration {
824
836
/// Timeout configuration.
825
- public struct Timeout {
837
+ struct Timeout {
826
838
/// Specifies connect timeout.
827
839
public var connect : TimeAmount ?
828
840
/// Specifies read timeout.
@@ -840,7 +852,7 @@ extension HTTPClient.Configuration {
840
852
}
841
853
842
854
/// Specifies redirect processing settings.
843
- public struct RedirectConfiguration {
855
+ struct RedirectConfiguration {
844
856
enum Configuration {
845
857
/// Redirects are not followed.
846
858
case disallow
@@ -872,7 +884,7 @@ extension HTTPClient.Configuration {
872
884
}
873
885
874
886
/// Connection pool configuration.
875
- public struct ConnectionPool : Hashable {
887
+ struct ConnectionPool : Hashable {
876
888
// Specifies amount of time connections are kept idle in the pool.
877
889
public var idleTimeout : TimeAmount
878
890
0 commit comments