SimpleThrottle 1.0.3

dotnet add package SimpleThrottle --version 1.0.3
NuGet\Install-Package SimpleThrottle -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimpleThrottle" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleThrottle --version 1.0.3
#r "nuget: SimpleThrottle, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SimpleThrottle as a Cake Addin
#addin nuget:?package=SimpleThrottle&version=1.0.3

// Install SimpleThrottle as a Cake Tool
#tool nuget:?package=SimpleThrottle&version=1.0.3

Simple Throttle

This small library provides a simple thread-safe object which throttles an arbitrary set of actions, rate limiting them to the specified number of actions within the specified timespan.

Installation

Simple Throttle is available via NuGet and can be installed easily via the command line:

dotnet add package SimpleThrottle

Usage

First add the library to your using statements:

using SimpleThrottle;

Then the provided Throttler object can be instantiated as follows:

var throttler = new Throttler(int requestLimit, int timespanInMilliseconds);

If you wish to restrict multiple different actions to a single rate limit, you can also easily wrap a single Throttler object in a service class and provide it to various methods using dependency injection.

After your Throttler object has been instantiated, simply invoke the MakeRequest method immediately before calling each action you wish to rate limit like so:

foreach (var object in objects)
{
    throttler.MakeRequest();
    await SomeClass.RateLimitedAction(object);
}

That's it!

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 129 12/28/2023
1.0.2 84 12/28/2023
1.0.1 96 12/28/2023
1.0.0 89 12/27/2023