CounterStore for ThrottlingTroll. Stores counters in Redis.
$ dotnet add package ThrottlingTroll.CounterStores.RedisICounterStore implementation that uses Redis.
Fast, consistent and reliable.
Install package from NuGet:
dotnet add package ThrottlingTroll.CounterStores.Redis
EITHER put RedisCounterStore instance into your DI container:
builder.Services.AddSingleton<ICounterStore>(
new RedisCounterStore(ConnectionMultiplexer.Connect("my-redis-connection-string"))
);
OR provide an instance of it via .UseThrottlingTroll() method:
app.UseThrottlingTroll(options =>
{
options.CounterStore = new RedisCounterStore(ConnectionMultiplexer.Connect("my-redis-connection-string"));
});