0

I have this simple controller:

   [HttpGet, ActionName("analysis")]
        public async Task<StatusResultModel> Analysis(Guid api_key)
        {Thread.Sleep(10000);}

What I need to achieve, is to limit the access per user base, so that each user will be able to make only one HTTP request to this controller.

So if someone makes two parallel requests, the first request stars processing, but the second request will block until the first one is not done.

1 Answer 1

2

You will need to store the state of requests by each api key and manage this accordingly. Add an entry to your state when they start, check for existence on each request, and remove when done.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.