Class Throttle
Base class defining throttle interface
Inheritance
System.Object
Throttle
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: NFX.dll
Syntax
public abstract class Throttle : ApplicationComponent, IConfigurable, IThrottle, IApplicationComponent, IDisposable
Constructors
Throttle()
Declaration
Throttle(String, String)
Constructor that identifies throttle by name, and optionally defines the
unit of measurement for this throttle instance
Declaration
protected Throttle(string name, string unit = null)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.String |
unit |
|
Properties
Name
Returns the unique name of this instance
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
Throttling
References the Throttling that this instance is registered with
Declaration
public IThrottling Throttling { get; }
Property Value
Unit
Returns the name of unit of measurement for this instance
Declaration
public string Unit { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Declaration
public void Configure(IConfigSectionNode node)
Parameters
Destructor()
Declaration
protected override void Destructor()
Overrides
Declaration
protected virtual void DoConfigure(IConfigSectionNode node)
Parameters
Register(IThrottling)
Register this instance with throttling container
Declaration
public void Register(IThrottling throttling)
Parameters
Reset()
Reset the internal state of the throttle
Declaration
public abstract void Reset()
Try()
Checks whether the current throttle rate limit has not been reached
per one unit of measurement. This method is usually used to throttle based
on pass count
Declaration
public virtual bool Try()
Returns
Type |
Description |
System.Boolean |
|
Try(Double)
Checks whether the current throttle rate limit has not been reached
for the provided value. This method is usually used to throttle based
on values like financial amounts, data volumes, user counts, etc.
Declaration
public virtual bool Try(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
Type |
Description |
System.Boolean |
|
Unregister()
Unregister this instance from throttling container
Declaration
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IDisposable
Extension Methods