@@ -46,7 +46,7 @@ protocol _TracingSupportOperations {
46
46
// associatedtype TracerType
47
47
48
48
/// Starts the "overall" Span that encompases the beginning of a request until receipt of the head part of the response.
49
- mutating func startRequestSpan( tracer: Any ? )
49
+ mutating func startRequestSpan< T > ( tracer: T ? )
50
50
51
51
/// Fails the active overall span given some internal error, e.g. timeout, pool shutdown etc.
52
52
/// This is not to be used for failing a span given a failure status coded HTTPResponse.
@@ -64,13 +64,14 @@ extension RequestBag.LoopBoundState: _TracingSupportOperations {}
64
64
#if !TracingSupport
65
65
/// Operations used to start/end spans at apropriate times from the Request lifecycle.
66
66
extension RequestBag . LoopBoundState {
67
- typealias TracerType = HTTPClientTracingSupportTracerType
68
-
69
67
@inlinable
70
- mutating func startRequestSpan( tracer: Any ? ) { }
68
+ mutating func startRequestSpan< T > ( tracer: T ? ) { }
71
69
72
70
@inlinable
73
71
mutating func failRequestSpan( error: any Error ) { }
72
+
73
+ @inlinable
74
+ mutating func failRequestSpanAsCancelled( ) { }
74
75
75
76
@inlinable
76
77
mutating func endRequestSpan( response: HTTPResponseHead ) { }
@@ -81,12 +82,9 @@ extension RequestBag.LoopBoundState {
81
82
extension RequestBag . LoopBoundState {
82
83
// typealias TracerType = Tracer
83
84
84
- mutating func startRequestSpan( tracer: Any ? ) {
85
+ mutating func startRequestSpan< T > ( tracer: T ? ) {
85
86
guard #available( macOS 10 . 15 , iOS 13 , tvOS 13 , watchOS 6 , * ) ,
86
- let tracer = tracer as? ( any Tracer ) ? ,
87
- let tracer else {
88
- // print("[swift][\(#fileID):\(#line)] MISSING TRACER: \(tracer)")
89
- fatalError ( " [swift][ \( #fileID) : \( #line) ] MISSING TRACER: \( tracer) " )
87
+ let tracer = tracer as! ( any Tracer ) ? else {
90
88
return
91
89
}
92
90
0 commit comments