private async Task StartPolling() { while (true) { try { if (_ct.IsCancellationRequested) { break; } var i = await _proxy.FetchWork(); if (i > 0) { ServiceEventSource.Current.Message($"Received: {i}"); } } catch (Exception ex) { ServiceEventSource.Current.Message("ERROR:" + ex.ToString()); } } }