private async void OnMiningInfoChanged() { try { await Task.Factory.StartNew(() => MiningInfoChanged?.Invoke(this, EventArgs.Empty)).ConfigureAwait(false); } catch (Exception ex) { _logger.LogError(ex, "An unhandled exception occured in a MiningInfoChanged event handler"); } }
private void OnMiningInfoChanged() { var miningInfoChanged = MiningInfoChanged; Task.Factory.StartNew(() => { try { MiningInfoChanged?.Invoke(this, EventArgs.Empty); } catch { // Ignored } }); }