Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: RT.Util.Threading.RateLimitedAction

Summary

Simplifies the task of performing a certain action on an arbitrary thread with a certain minimum interval between two invocations. Only a single thread will execute the task; no threads will block waiting for that.

Constructors

RateLimitedAction(TimeSpan minActionInterval)
Constructor.

Instance methods

void
Check(Action action)
Checks whether it is time to execute the action. If so, executes it on the calling thread and returns only when the action is complete. If not, returns very quickly without blocking. If another thread is currently executing the action, returns very quickly without blocking.
void Makes it so that the action will occur as soon as possible - namely, the next time a thread invokes the RateLimitedAction.Check(Action) method.
void Makes it so that the next action will occur no earlier than the RateLimitedAction.MinActionInterval. If action is already in progress, it will complete as usual.

Instance properties

TimeSpanGets/sets the minimum interval between two invocations.