@@ -35,23 +35,19 @@ internal final class ConnectionManager: @unchecked Sendable {
35
35
var reconnect : Reconnect
36
36
37
37
var candidate : EventLoopFuture < Channel >
38
- var readyChannelMuxPromise : EventLoopPromise < NIOHTTP2Handler . StreamMultiplexer >
39
- var candidateMuxPromise : EventLoopPromise < NIOHTTP2Handler . StreamMultiplexer >
38
+ var readyChannelMuxPromise : EventLoopPromise < HTTP2StreamMultiplexer >
39
+ var candidateMuxPromise : EventLoopPromise < HTTP2StreamMultiplexer >
40
40
}
41
41
42
42
internal struct ConnectedState {
43
43
var backoffIterator : ConnectionBackoffIterator ?
44
44
var reconnect : Reconnect
45
45
var candidate : Channel
46
- var readyChannelMuxPromise : EventLoopPromise < NIOHTTP2Handler . StreamMultiplexer >
47
- var multiplexer : NIOHTTP2Handler . StreamMultiplexer
46
+ var readyChannelMuxPromise : EventLoopPromise < HTTP2StreamMultiplexer >
47
+ var multiplexer : HTTP2StreamMultiplexer
48
48
var error : Error ?
49
49
50
- init (
51
- from state: ConnectingState ,
52
- candidate: Channel ,
53
- multiplexer: NIOHTTP2Handler . StreamMultiplexer
54
- ) {
50
+ init ( from state: ConnectingState , candidate: Channel , multiplexer: HTTP2StreamMultiplexer ) {
55
51
self . backoffIterator = state. backoffIterator
56
52
self . reconnect = state. reconnect
57
53
self . candidate = candidate
@@ -62,7 +58,7 @@ internal final class ConnectionManager: @unchecked Sendable {
62
58
63
59
internal struct ReadyState {
64
60
var channel : Channel
65
- var multiplexer : NIOHTTP2Handler . StreamMultiplexer
61
+ var multiplexer : HTTP2StreamMultiplexer
66
62
var error : Error ?
67
63
68
64
init ( from state: ConnectedState ) {
@@ -73,7 +69,7 @@ internal final class ConnectionManager: @unchecked Sendable {
73
69
74
70
internal struct TransientFailureState {
75
71
var backoffIterator : ConnectionBackoffIterator ?
76
- var readyChannelMuxPromise : EventLoopPromise < NIOHTTP2Handler . StreamMultiplexer >
72
+ var readyChannelMuxPromise : EventLoopPromise < HTTP2StreamMultiplexer >
77
73
var scheduled : Scheduled < Void >
78
74
var reason : Error
79
75
@@ -256,8 +252,8 @@ internal final class ConnectionManager: @unchecked Sendable {
256
252
}
257
253
}
258
254
259
- /// Returns the `NIOHTTP2Handler.StreamMultiplexer ` from the 'ready' state or `nil` if it is not available.
260
- private var multiplexer : NIOHTTP2Handler . StreamMultiplexer ? {
255
+ /// Returns the `HTTP2StreamMultiplexer ` from the 'ready' state or `nil` if it is not available.
256
+ private var multiplexer : HTTP2StreamMultiplexer ? {
261
257
self . eventLoop. assertInEventLoop ( )
262
258
switch self . state {
263
259
case let . ready( state) :
@@ -365,8 +361,8 @@ internal final class ConnectionManager: @unchecked Sendable {
365
361
/// Get the multiplexer from the underlying channel handling gRPC calls.
366
362
/// if the `ConnectionManager` was configured to be `fastFailure` this will have
367
363
/// one chance to connect - if not reconnections are managed here.
368
- internal func getHTTP2Multiplexer( ) -> EventLoopFuture < NIOHTTP2Handler . StreamMultiplexer > {
369
- func getHTTP2Multiplexer0( ) -> EventLoopFuture < NIOHTTP2Handler . StreamMultiplexer > {
364
+ internal func getHTTP2Multiplexer( ) -> EventLoopFuture < HTTP2StreamMultiplexer > {
365
+ func getHTTP2Multiplexer0( ) -> EventLoopFuture < HTTP2StreamMultiplexer > {
370
366
switch self . callStartBehavior {
371
367
case . waitsForConnectivity:
372
368
return self . getHTTP2MultiplexerPatient ( )
@@ -386,8 +382,8 @@ internal final class ConnectionManager: @unchecked Sendable {
386
382
387
383
/// Returns a future for the multiplexer which succeeded when the channel is connected.
388
384
/// Reconnects are handled if necessary.
389
- private func getHTTP2MultiplexerPatient( ) -> EventLoopFuture < NIOHTTP2Handler . StreamMultiplexer > {
390
- let multiplexer : EventLoopFuture < NIOHTTP2Handler . StreamMultiplexer >
385
+ private func getHTTP2MultiplexerPatient( ) -> EventLoopFuture < HTTP2StreamMultiplexer > {
386
+ let multiplexer : EventLoopFuture < HTTP2StreamMultiplexer >
391
387
392
388
switch self . state {
393
389
case . idle:
@@ -425,12 +421,11 @@ internal final class ConnectionManager: @unchecked Sendable {
425
421
/// attempt, or if the state is 'idle' returns the future for the next connection attempt.
426
422
///
427
423
/// Note: if the state is 'transientFailure' or 'shutdown' then a failed future will be returned.
428
- private func getHTTP2MultiplexerOptimistic( )
429
- -> EventLoopFuture < NIOHTTP2Handler . StreamMultiplexer > {
424
+ private func getHTTP2MultiplexerOptimistic( ) -> EventLoopFuture < HTTP2StreamMultiplexer > {
430
425
// `getHTTP2Multiplexer` makes sure we're on the event loop but let's just be sure.
431
426
self . eventLoop. preconditionInEventLoop ( )
432
427
433
- let muxFuture : EventLoopFuture < NIOHTTP2Handler . StreamMultiplexer > = { ( ) in
428
+ let muxFuture : EventLoopFuture < HTTP2StreamMultiplexer > = { ( ) in
434
429
switch self . state {
435
430
case . idle:
436
431
self . startConnecting ( )
@@ -661,7 +656,7 @@ internal final class ConnectionManager: @unchecked Sendable {
661
656
}
662
657
663
658
/// The connecting channel became `active`. Must be called on the `EventLoop`.
664
- internal func channelActive( channel: Channel , multiplexer: NIOHTTP2Handler . StreamMultiplexer ) {
659
+ internal func channelActive( channel: Channel , multiplexer: HTTP2StreamMultiplexer ) {
665
660
self . eventLoop. preconditionInEventLoop ( )
666
661
self . logger. debug ( " activating connection " , metadata: [
667
662
" connectivity_state " : " \( self . state. label) " ,
@@ -978,7 +973,7 @@ extension ConnectionManager {
978
973
979
974
private func startConnecting(
980
975
backoffIterator: ConnectionBackoffIterator ? ,
981
- muxPromise: EventLoopPromise < NIOHTTP2Handler . StreamMultiplexer >
976
+ muxPromise: EventLoopPromise < HTTP2StreamMultiplexer >
982
977
) {
983
978
let timeoutAndBackoff = backoffIterator? . next ( )
984
979
@@ -1065,7 +1060,7 @@ extension ConnectionManager {
1065
1060
1066
1061
/// Returns the `multiplexer` from a connection in the `ready` state or `nil` if it is any
1067
1062
/// other state.
1068
- internal var multiplexer : NIOHTTP2Handler . StreamMultiplexer ? {
1063
+ internal var multiplexer : HTTP2StreamMultiplexer ? {
1069
1064
return self . manager. multiplexer
1070
1065
}
1071
1066
0 commit comments