Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

🌸 2.0.0 #43

Open
wants to merge 79 commits into
base: master
Choose a base branch
from
Open

🌸 2.0.0 #43

wants to merge 79 commits into from

Conversation

BlossomiShymae
Copy link
Owner

@BlossomiShymae BlossomiShymae commented Oct 9, 2023

I'll be keeping this PR here until I finish it. Should solve issues with rate limiter and library complexity. Will be bumping framework requirement to the upcoming .NET 8 LTS release. 💚

  • Client
  • Static
  • Caching (None, Memory, File System)
    • TTL method configuration
    • Manual flushing / clearing
  • Limiting (None, Burst, Spread)
  • Logging
  • Testing
    • Method tests
    • Limiter stress tests
    • Cache expiration tests
  • Documentation
    • Version dropdown (to seperate docs from 1.X)
    • Introduction
      • CLI
      • Razor Pages
      • Web API
    • Examples
      • LoL
      • TFT
      • LoR
    • Caching
    • Limiting

Comment on lines +19 to +25
public ILogger Logger { get; set; } = LoggerFactory
.Create(c =>
{
c.AddConsole();
c.SetMinimumLevel(LogLevel.Debug);
})
.CreateLogger("RiotBlossom");
Copy link

@AoshiW AoshiW Oct 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should set it to NullLogger, it is better if the user sets it up himself

Currently it has several problems, for example:

  • inability to change LogLevel
  • inability to remove the current Console Logger
  • inability to add another Logger Provider

Comment on lines +18 to +24
protected async override Task<string?> ReadAsync(string key)
{
var json = _cache[key];

return await Task.FromResult(json)
.ConfigureAwait(false);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method does not have to be async

Comment on lines +14 to +18
protected async override Task<string?> ReadAsync(string key)
{
return await Task.FromResult<string?>(null)
.ConfigureAwait(false);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method does not have to be async

}
}

protected abstract Task<string?> ReadAsync(string key);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the return type could be ValueTask<string?>

Comment on lines +11 to +16
public async override Task ProcessRequestAsync(DataCall call, HttpRequestMessage req)
{
// NO-OP
await Task.CompletedTask
.ConfigureAwait(false);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method does not have to be async

Comment on lines +31 to +33
var delay = delays
.OrderByDescending(x => x.Ticks)
.First();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps MaxBy could be used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants