Esempio n. 1
0
 public void Retry_Synchronous_Succeeds()
 {
     SyncPolicy.Execute(() => Workloads.Action());
 }
Esempio n. 2
0
 public async Task Retry_Asynchronous_Succeeds()
 {
     await AsyncPolicy.ExecuteAsync(() => Workloads.ActionAsync());
 }
Esempio n. 3
0
 public async Task NoOp_Asynchronous()
 {
     await AsyncPolicy.ExecuteAsync((token) => Workloads.ActionAsync(token), CancellationToken.None);
 }
Esempio n. 4
0
 public int NoOp_Synchronous_With_Result()
 {
     return(SyncPolicy.Execute(() => Workloads.Func <int>()));
 }
Esempio n. 5
0
 public async Task CircuitBreaker_Asynchronous_Succeeds()
 {
     await AsyncPolicy.ExecuteAsync((token) => Workloads.ActionAsync(token), CancellationToken.None);
 }
Esempio n. 6
0
 public void NoOp_Synchronous()
 {
     SyncPolicy.Execute(() => Workloads.Action());
 }
Esempio n. 7
0
 public async Task <int> Fallback_Asynchronous_Succeeds()
 {
     return(await AsyncPolicy.ExecuteAsync(() => Workloads.FuncAsync <int>()));
 }
Esempio n. 8
0
 public async Task <int> Retry_Asynchronous_With_Result_Succeeds()
 {
     return(await AsyncPolicy.ExecuteAsync(() => Workloads.FuncAsync <int>()));
 }
Esempio n. 9
0
 public async Task <int> Bulkhead_Asynchronous_With_Result()
 {
     return(await AsyncPolicy.ExecuteAsync(() => Workloads.FuncAsync <int>()));
 }
Esempio n. 10
0
 public int Fallback_Synchronous_Succeeds()
 {
     return(SyncPolicy.Execute(() => Workloads.Func <int>()));
 }
Esempio n. 11
0
 public async Task Bulkhead_Asynchronous()
 {
     await AsyncPolicy.ExecuteAsync(() => Workloads.ActionAsync());
 }
Esempio n. 12
0
 public void Bulkhead_Synchronous()
 {
     SyncPolicy.Execute(() => Workloads.Action());
 }
Esempio n. 13
0
 public async Task Timeout_Asynchronous_Times_Out_Optimistic()
 {
     await AsyncPolicy.ExecuteAsync((token) => Workloads.ActionInfiniteAsync(token), CancellationToken.None);
 }
Esempio n. 14
0
 public async Task Retry_Asynchronous_Succeeds_With_CancellationToken()
 {
     await AsyncPolicy.ExecuteAsync((token) => Workloads.ActionAsync(token), CancellationToken.None);
 }
Esempio n. 15
0
 public int Fallback_Synchronous_Throws()
 {
     return(SyncPolicy.Execute(() => Workloads.FuncThrows <int, InvalidOperationException>()));
 }
Esempio n. 16
0
 public int Retry_Synchronous_With_Result_Succeeds()
 {
     return(SyncPolicy.Execute(() => Workloads.Func <int>()));
 }
Esempio n. 17
0
 public async Task <int> Fallback_Asynchronous_Throws()
 {
     return(await AsyncPolicy.ExecuteAsync(() => Workloads.FuncThrowsAsync <int, InvalidOperationException>()));
 }
Esempio n. 18
0
 public async Task <int> Retry_Asynchronous_With_Result_Succeeds_With_CancellationToken()
 {
     return(await AsyncPolicy.ExecuteAsync((token) => Workloads.FuncAsync <int>(token), CancellationToken.None));
 }
Esempio n. 19
0
 public void CircuitBreaker_Synchronous_Succeeds()
 {
     SyncPolicy.Execute(() => Workloads.Action());
 }