-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathInjectBehaviourOptions.cs
35 lines (31 loc) · 1.03 KB
/
InjectBehaviourOptions.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
32
33
34
35
using System;
using System.Threading;
namespace Polly.Contrib.Simmy.Behavior.Options
{
/// <summary>
/// Options used to configure an <see cref="AsyncInjectBehaviourPolicy"/>
/// </summary>
public class InjectBehaviourOptions
{
/// <summary>
/// Behaviour Delegate to be executed
/// </summary>
public Action<Context, CancellationToken> Behaviour { get; set; }
/// <summary>
/// Lambda to get injection rate between [0, 1]
/// </summary>
public Func<Context, CancellationToken, Double> InjectionRate{ get; set; }
/// <summary>
/// Lambda to check if this policy is enabled in current context
/// </summary>
public Func<Context, CancellationToken, bool> Enabled{ get; set; }
}
/// <inheritdoc/>
public class InjectBehaviourBasicOptions : DefaultOptions
{
/// <summary>
/// Behaviour Delegate to be executed without context
/// </summary>
public Action Behaviour { get; set; }
}
}