Skip to content

Commit 7409c35

Browse files
remove Context.run method to avoid breaking change
1 parent 50c0982 commit 7409c35

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

example/zone_context_manager.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'dart:async';
33
import 'package:opentelemetry/api.dart';
44
import 'package:opentelemetry/sdk.dart'
55
show ConsoleExporter, SimpleSpanProcessor, TracerProviderBase;
6+
import 'package:opentelemetry/src/api/context/zone_context.dart';
67
import 'package:opentelemetry/src/experimental_api.dart'
78
show globalContextManager, registerGlobalContextManager, ZoneContextManager;
89

@@ -15,7 +16,7 @@ void main(List<String> args) async {
1516
registerGlobalContextManager(cm);
1617

1718
final span = tp.getTracer('instrumentation-name').startSpan('test-span-0');
18-
await contextWithSpan(cm.active, span).run((_) => test());
19+
await (contextWithSpan(cm.active, span) as ZoneContext).run((_) => test());
1920
span.end();
2021
}
2122

lib/src/api/context/context.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ abstract class Context {
7474
'This method will be removed in 0.19.0. Propagate [Context] as an argument to [fn].')
7575
R execute<R>(R Function() fn);
7676

77-
R run<R>(R Function(Context context) fn);
78-
7977
/// Get the [Span] attached to this [Context], or an invalid, [Span] if no such
8078
/// [Span] exists.
8179
@Deprecated(

0 commit comments

Comments
 (0)