private static async Task InvokeAsync(ThrottleOptions options)
        {
            var middleware = new ThrottleMiddleware(options);

            RequestProcessorCallback next = async context =>
            {
                SimpleLock.Take();

                await Task.Delay(100);

                SimpleLock.Release();
            };

            var requests = Enumerable
                           .Repeat(new Context(new FakeRequest()), 10)
                           .Select(ctx => Task.Run(() => middleware.InvokeAsync(ctx, next)));

            await Task.WhenAll(requests);
        }
 public ThrottleMiddleware(ThrottleOptions options)
 {
     _options    = options;
     _semaphores = new Dictionary <string, SemaphoreSlim>();
 }