Updating items in a list from a blocking source asynchronously
My try to simplify and prettify the method.
Avoid using globals in async code, pass Token as argument.
// optimized out async State Machine
private Task UpdateLogsAsync(IProgress&lt;string&gt; status, CancellationToken token) =&gt; Task.Run(async () =&gt;
{
    await foreach (var message in this.Server.GetLogMessages().WithCancellation(token))
    {
        status.Report(message);
    }
}, token);

Usage
// synchronized callback. Create new in UI Thread and its body will be always executed there.
IProgress&lt;string&gt; status = new Progess&lt;string&gt;(message =&gt;
{
    this.textLogs.AppendText($&quot;{message}{Environment.NewLine}&quot;);
});
try
{
    await UpdateLogsAsync(status, this.CancellationTokenSource.Token);
}
catch (OperationCanceledException ex)
{
    status.Report(ex.Message);
}