0

I am still learning Asp.net MVC but I want to create a way for a user to cancel a search if it's taking too long. I am running VS 2010 and upgrading to 2012 is not an option, so I will not be able to use async/await options.

I have been researching and I can't find a clear cut example/way of doing this with ASP.NET MVC framework without async/await. If I use separate threads, it could be a bad idea because IIS may kill it after 3 min or so. Also, because the controller is instantiated each time a call to the server is made, how would I communicate back to the "stop variable" in the thread? Should I use a web service instead and use this to pull the searches and handle threading? I am confused.

thank you.

eaglei22
  • 2,589
  • 1
  • 38
  • 53
  • 1
    You definitely need to rearchitecture that totally. If a single request takes several minutes and during this time the server works hard, think of what few dozens of users can do to your infrastructure if they all perform search in the same time. You just get ddosed by legitimate users. – Wiktor Zychla Aug 10 '16 at 19:40
  • What causes the long delay? Is this a database search? – Gary Aug 10 '16 at 19:45
  • This type of search would be for only a few privileged users every so often for large data pulls, transaction auditing, etc from a db/2 database. So I want to leave the search criteria pretty open, but allow them to cancel if the search takes longer than the user has patients or wanted to change their criteria. – eaglei22 Aug 11 '16 at 02:07

0 Answers0