Class CountByIntervalAwaitableConstraint
Provide an awaitable constraint based on number of times per duration
Inheritance
System.Object
CountByIntervalAwaitableConstraint
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: RateLimiter
Assembly: RateLimiter.dll
Syntax
public class CountByIntervalAwaitableConstraint : IAwaitableConstraint
Constructors
| Improve this Doc View SourceCountByIntervalAwaitableConstraint(Int32, TimeSpan)
Constructs a new AwaitableConstraint based on number of times per duration
Declaration
public CountByIntervalAwaitableConstraint(int count, TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | |
System.TimeSpan | timeSpan |
Properties
| Improve this Doc View Source_TimeStamps
Stack of the last time stamps
Declaration
protected LimitedSizeStack<DateTime> _TimeStamps { get; }
Property Value
Type | Description |
---|---|
LimitedSizeStack<System.DateTime> |
TimeStamps
List of the last time stamps
Declaration
public IReadOnlyList<DateTime> TimeStamps { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.DateTime> |
Methods
| Improve this Doc View SourceClone()
Clone CountByIntervalAwaitableConstraint
Declaration
public IAwaitableConstraint Clone()
Returns
Type | Description |
---|---|
IAwaitableConstraint |
OnEnded(DateTime)
Called when action has been executed
Declaration
protected virtual void OnEnded(DateTime now)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | now |
WaitForReadiness(CancellationToken)
returns a task that will complete once the constraint is fulfilled
Declaration
public Task<IDisposable> WaitForReadiness(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Cancel the wait |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.IDisposable> | A disposable that should be disposed upon task completion |