I want to build a WebAPI that simply wait for 10 seconds. So I use ASP.NET Core Web Application (.Net Core) template, and changed ValuesController.cs to wait for 10 seconds.
public IEnumerable<string> Get()
{
System.Threading.Thread.Sleep(10000);//add this row
return new string[] { "value1", "value2" };
}
But, this WebAPI has a problem. When some clients access WebAPI at the same time, second or later client must wait for more than 10 seconds. Please tell me how to process two or more sessions.