Skip to content

Commit

Permalink
add clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
birschick-bq committed Feb 7, 2025
1 parent 5481238 commit 07dba27
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ internal static bool TryCreate(
FileExporter fileExporter = new(fileBaseName, tracesDirectory, maxTraceFileSizeKb, maxTraceFiles);
return new FileExporterInstance(
fileExporter,
// This listens/polls for activity in the queue and writes them to file
Task.Run(async () => await ProcessActivitiesAsync(fileExporter, cancellationTokenSource.Token)),
cancellationTokenSource);
});
Expand Down Expand Up @@ -128,6 +129,7 @@ public override ExportResult Export(in Batch<Activity> batch)
private static async Task ProcessActivitiesAsync(FileExporter fileExporter, CancellationToken cancellationToken)
{
TimeSpan delay = TimeSpan.FromMilliseconds(100);
// Polls for and then writes any activities in the queue
while (!cancellationToken.IsCancellationRequested)
{
await Task.Delay(delay, cancellationToken);
Expand Down

0 comments on commit 07dba27

Please sign in to comment.