protected override async Task <IExecutionResult> ExecuteInternal(BreakerExecutionContext executionContext) { await this._lock.WaitAsync(); try { var t = executionContext.Action(); t.Wait(); this._successCount++; if (this._successCount > 0) { this.StateManager.Close(); } return(new SuccessExecutionResult(base.GetResultFactory(t))); } catch (Exception e) { return(await this.Trip(e, executionContext)); } finally { this._lock.Release(); } }
protected override Task <IExecutionResult> ExecuteInternal(BreakerExecutionContext executionContext) { var t = executionContext.Action(); t.Wait(); return(Task.FromResult <IExecutionResult>(new SuccessExecutionResult(base.GetResultFactory(t)))); }