Interface IThrottle
Inherited Members
System.IDisposable.Dispose()
Namespace: NFX.Throttling
Assembly: NFX.dll
Syntax
public interface IThrottle : IApplicationComponent, IDisposable
Properties
Name
Returns the unique name of this instance
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Unit
Returns the name of unit of measurement for this instance
Declaration
string Unit { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Register(IThrottling)
Register this instance with throttling container
Declaration
void Register(IThrottling throttling)
Parameters
Type | Name | Description |
---|---|---|
IThrottling | throttling |
Reset()
Reset the internal state of the throttle
Declaration
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
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
bool Try(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value |
Returns
Type | Description |
---|---|
System.Boolean |
Unregister()
Unregister this instance from throttling container
Declaration
bool Unregister()
Returns
Type | Description |
---|---|
System.Boolean |