using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Wabbajack.RateLimiter; public interface IResource { StatusReport StatusReport { get; } string Name { get; } int MaxTasks { get; set; } long MaxThroughput { get; set; } IEnumerable Jobs { get; } } public interface IResource : IResource { public ValueTask> Begin(string jobTitle, long size, CancellationToken token); ValueTask Report(Job job, int processedSize, CancellationToken token); void ReportNoWait(Job job, int processedSize); void Finish(Job job); }