-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRetryConfiguration.mustache
More file actions
41 lines (37 loc) · 1.02 KB
/
RetryConfiguration.mustache
File metadata and controls
41 lines (37 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{{>partial_header}}
using Polly;
{{#useRestSharp}}
using RestSharp;
{{/useRestSharp}}
{{#useHttpClient}}
using System.Net.Http;
{{/useHttpClient}}
namespace {{packageName}}.Client
{
/// <summary>
/// Configuration class to set the polly retry policies to be applied to the requests.
/// </summary>
public static class RetryConfiguration
{
{{#useRestSharp}}
/// <summary>
/// Retry policy
/// </summary>
public static Policy<RestResponse> RetryPolicy { get; set; }
/// <summary>
/// Async retry policy
/// </summary>
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
{{/useRestSharp}}
{{#useHttpClient}}
/// <summary>
/// Retry policy
/// </summary>
public static Policy<HttpResponseMessage> RetryPolicy { get; set; }
/// <summary>
/// Async retry policy
/// </summary>
public static AsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; }
{{/useHttpClient}}
}
}