-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathStrategyBuilderContext.cs
More file actions
48 lines (41 loc) · 1.34 KB
/
StrategyBuilderContext.cs
File metadata and controls
48 lines (41 loc) · 1.34 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
using Polly.Telemetry;
namespace Polly;
/// <summary>
/// The context used for building an individual resilience strategy.
/// </summary>
public sealed class StrategyBuilderContext
{
internal StrategyBuilderContext(
string? builderName,
string? builderInstanceName,
string? strategyName,
TimeProvider timeProvider,
DiagnosticSource? diagnosticSource)
{
BuilderName = builderName;
BuilderInstanceName = builderInstanceName;
StrategyName = strategyName;
TimeProvider = timeProvider;
Telemetry = TelemetryUtil.CreateTelemetry(diagnosticSource, builderName, builderInstanceName, strategyName);
}
/// <summary>
/// Gets the name of the builder.
/// </summary>
public string? BuilderName { get; }
/// <summary>
/// Gets the instance name of the builder.
/// </summary>
public string? BuilderInstanceName { get; }
/// <summary>
/// Gets the name of the strategy.
/// </summary>
public string? StrategyName { get; }
/// <summary>
/// Gets the resilience telemetry used to report important events.
/// </summary>
public ResilienceStrategyTelemetry Telemetry { get; }
/// <summary>
/// Gets the <see cref="TimeProvider"/> used by this strategy.
/// </summary>
internal TimeProvider TimeProvider { get; }
}