Fork me on GitHub
Show / Hide Table of Contents

Class CountByIntervalAwaitableConstraint

Provide an awaitable constraint based on number of times per duration

Inheritance
System.Object
CountByIntervalAwaitableConstraint
PersistentCountByIntervalAwaitableConstraint
Implements
IAwaitableConstraint
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 Source

CountByIntervalAwaitableConstraint(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>
| Improve this Doc View Source

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 Source

Clone()

Clone CountByIntervalAwaitableConstraint

Declaration
public IAwaitableConstraint Clone()
Returns
Type Description
IAwaitableConstraint
| Improve this Doc View Source

OnEnded(DateTime)

Called when action has been executed

Declaration
protected virtual void OnEnded(DateTime now)
Parameters
Type Name Description
System.DateTime now
| Improve this Doc View Source

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

Implements

IAwaitableConstraint

Extension Methods

AwaitableConstraintExtension.Compose(IAwaitableConstraint, IAwaitableConstraint)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX