-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRetryEvent.cs
More file actions
53 lines (46 loc) · 1.43 KB
/
RetryEvent.cs
File metadata and controls
53 lines (46 loc) · 1.43 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
42
43
44
45
46
47
48
49
50
51
52
53
namespace DotNet.Sdk.Extensions.Polly.Http.Retry.Events;
/// <summary>
/// Contains the event data when a retry is triggered via Polly's timeout policy.
/// </summary>
public sealed class RetryEvent
{
internal RetryEvent(
string httpClientName,
RetryOptions retryOptions,
DelegateResult<HttpResponseMessage> outcome,
TimeSpan retryDelay,
int retryNumber,
Context context)
{
HttpClientName = httpClientName;
RetryOptions = retryOptions;
Outcome = outcome;
RetryDelay = retryDelay;
RetryNumber = retryNumber;
Context = context;
}
/// <summary>
/// Gets the name of the HttpClient that triggered this event.
/// </summary>
public string HttpClientName { get; }
/// <summary>
/// Gets the retry options applied to the HttpClient that triggered this event.
/// </summary>
public RetryOptions RetryOptions { get; }
/// <summary>
/// Gets result from the HttpClient execution.
/// </summary>
public DelegateResult<HttpResponseMessage> Outcome { get; }
/// <summary>
/// Gets the amount of time before the retry was executed.
/// </summary>
public TimeSpan RetryDelay { get; }
/// <summary>
/// Gets the number of the retry.
/// </summary>
public int RetryNumber { get; }
/// <summary>
/// Gets the Polly Context.
/// </summary>
public Context Context { get; }
}