Skip to content

gruan01/Throttle

Repository files navigation

Throttle

Action throttle in a period.

If you want execute some action 10 times in one second, you can use it like this:

InProcess

Throttle TS = new Throttle("ThrottleName", TimeSpan.FromSeconds(1), 10);
...
this.TS.Execute(()=> ...);
...

Cross Process

var conn = RedisExchangeManager.GetConnection("Throttle");
this.Counter = new RedisCounter(conn);
this.TS = new Throttle("ThrottleName", TimeSpan.FromSeconds(1), 10, counter:this.Counter);

NUGET

AsNum.Throttle

AsNum.Throttle.Redis

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages