-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
ResiliencePipeline.cs
31 lines (25 loc) · 1.12 KB
/
ResiliencePipeline.cs
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
using Polly.Utils.Pipeline;
namespace Polly;
/// <summary>
/// Resilience pipeline is used to execute the user-provided callbacks.
/// </summary>
/// <remarks>
/// Resilience pipeline supports various types of callbacks and provides a unified way to execute them.
/// This includes overloads for synchronous and asynchronous callbacks, generic and non-generic callbacks.
/// </remarks>
public sealed partial class ResiliencePipeline
{
/// <summary>
/// Resilience pipeline that executes the user-provided callback without any additional logic.
/// </summary>
public static readonly ResiliencePipeline Empty = new(PipelineComponent.Empty, DisposeBehavior.Ignore, null);
internal ResiliencePipeline(PipelineComponent component, DisposeBehavior disposeBehavior, ResilienceContextPool? pool)
{
Component = component;
DisposeHelper = new ComponentDisposeHelper(component, disposeBehavior);
Pool = pool ?? ResilienceContextPool.Shared;
}
internal ResilienceContextPool Pool { get; }
internal PipelineComponent Component { get; }
internal ComponentDisposeHelper DisposeHelper { get; }
}