Skip to content

Commit

Permalink
feat: Add async flush method
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Dec 18, 2024
1 parent b36ae23 commit 7cc1879
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Uno.DevTools.Telemetry/Telemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ public void Flush()
}
}

public async Task FlushAsync()
{
if (!Enabled || _trackEventTask == null)
{
return;
}

// Skip the wait if the task has not yet been activated
if (_trackEventTask.Status != TaskStatus.WaitingForActivation)
{
await _trackEventTask;
}
}

public void Dispose()
{
_persistenceChannel?.Dispose();
Expand Down

0 comments on commit 7cc1879

Please sign in to comment.