File tree 4 files changed +4
-24
lines changed
opentelemetry-context-base/src
opentelemetry-context-zone-peer-dep/src
4 files changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,10 @@ export class NoopContextManager implements types.ContextManager {
22
22
return Context . ROOT_CONTEXT ;
23
23
}
24
24
25
- with ( context : Context , fn : Function ) {
26
- return fn ( ) ;
27
- }
28
-
29
- withAsync ( context : Context , fn : Function ) {
25
+ with < T extends ( ...args : unknown [ ] ) => ReturnType < T > > (
26
+ context : Context ,
27
+ fn : T
28
+ ) : ReturnType < T > {
30
29
return fn ( ) ;
31
30
}
32
31
Original file line number Diff line number Diff line change @@ -32,17 +32,6 @@ export interface ContextManager {
32
32
fn : T
33
33
) : ReturnType < T > ;
34
34
35
- /**
36
- * Run the async fn callback with an active scope
37
- *
38
- * @param scope Context to be active during function invocation
39
- * @param fn An async callback to be immediately run with an active context
40
- */
41
- withAsync < T extends Promise < any > , U extends ( ...args : unknown [ ] ) => T > (
42
- scope : Context ,
43
- fn : U
44
- ) : Promise < T > ;
45
-
46
35
/**
47
36
* Bind an object as the current context (or a specific one)
48
37
* @param target Any object to which a context need to be set
Original file line number Diff line number Diff line change @@ -248,8 +248,4 @@ export class ZoneContextManager implements ContextManager {
248
248
249
249
return newZone . run ( fn , context ) ;
250
250
}
251
-
252
- withAsync ( context : Context , fn : Function ) {
253
- return fn ( ) ;
254
- }
255
251
}
Original file line number Diff line number Diff line change @@ -119,8 +119,4 @@ export class StackContextManager implements ContextManager {
119
119
this . _currentContext = previousContext ;
120
120
}
121
121
}
122
-
123
- withAsync ( context : Context , fn : Function ) {
124
- return fn ( ) ;
125
- }
126
122
}
You can’t perform that action at this time.
0 commit comments