public void Retry_Synchronous_Succeeds() { SyncPolicy.Execute(() => Workloads.Action()); }
public async Task Retry_Asynchronous_Succeeds() { await AsyncPolicy.ExecuteAsync(() => Workloads.ActionAsync()); }
public async Task NoOp_Asynchronous() { await AsyncPolicy.ExecuteAsync((token) => Workloads.ActionAsync(token), CancellationToken.None); }
public int NoOp_Synchronous_With_Result() { return(SyncPolicy.Execute(() => Workloads.Func <int>())); }
public async Task CircuitBreaker_Asynchronous_Succeeds() { await AsyncPolicy.ExecuteAsync((token) => Workloads.ActionAsync(token), CancellationToken.None); }
public void NoOp_Synchronous() { SyncPolicy.Execute(() => Workloads.Action()); }
public async Task <int> Fallback_Asynchronous_Succeeds() { return(await AsyncPolicy.ExecuteAsync(() => Workloads.FuncAsync <int>())); }
public async Task <int> Retry_Asynchronous_With_Result_Succeeds() { return(await AsyncPolicy.ExecuteAsync(() => Workloads.FuncAsync <int>())); }
public async Task <int> Bulkhead_Asynchronous_With_Result() { return(await AsyncPolicy.ExecuteAsync(() => Workloads.FuncAsync <int>())); }
public int Fallback_Synchronous_Succeeds() { return(SyncPolicy.Execute(() => Workloads.Func <int>())); }
public async Task Bulkhead_Asynchronous() { await AsyncPolicy.ExecuteAsync(() => Workloads.ActionAsync()); }
public void Bulkhead_Synchronous() { SyncPolicy.Execute(() => Workloads.Action()); }
public async Task Timeout_Asynchronous_Times_Out_Optimistic() { await AsyncPolicy.ExecuteAsync((token) => Workloads.ActionInfiniteAsync(token), CancellationToken.None); }
public async Task Retry_Asynchronous_Succeeds_With_CancellationToken() { await AsyncPolicy.ExecuteAsync((token) => Workloads.ActionAsync(token), CancellationToken.None); }
public int Fallback_Synchronous_Throws() { return(SyncPolicy.Execute(() => Workloads.FuncThrows <int, InvalidOperationException>())); }
public int Retry_Synchronous_With_Result_Succeeds() { return(SyncPolicy.Execute(() => Workloads.Func <int>())); }
public async Task <int> Fallback_Asynchronous_Throws() { return(await AsyncPolicy.ExecuteAsync(() => Workloads.FuncThrowsAsync <int, InvalidOperationException>())); }
public async Task <int> Retry_Asynchronous_With_Result_Succeeds_With_CancellationToken() { return(await AsyncPolicy.ExecuteAsync((token) => Workloads.FuncAsync <int>(token), CancellationToken.None)); }
public void CircuitBreaker_Synchronous_Succeeds() { SyncPolicy.Execute(() => Workloads.Action()); }