Skip to content
Prev Previous commit
Next Next commit
use Task.Run to start worker
  • Loading branch information
MikeGoldsmith committed May 27, 2020
commit 74e623dfc7ae33a171808c6414ca32e9ce550b4a
3 changes: 1 addition & 2 deletions src/OpenTelemetry/Trace/Export/BatchingActivityProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ public BatchingActivityProcessor(ActivityExporter exporter, int maxQueueSize, Ti
this.exportQueue = new ConcurrentQueue<Activity>();

// worker task that will last for lifetime of processor.
// No need to specify long running - it is useless if any async calls are made internally.
// Threads are also useless as exporter tasks run in thread pool threads.
Task.Factory.StartNew(s => this.Worker((CancellationToken)s), this.cts.Token);
Task.Run(() => this.Worker(this.cts.Token), this.cts.Token);
}

/// <inheritdoc/>
Expand Down