I have a web service in ASP.NET being called by a time-sensitive process. If the web service takes longer than N seconds to run I want to return from the call so the time sensitive operation can continue. Is this possible and if so what is the code for this?
Share
Have the web service call its long-running part in a separate thread. Then wait, kill it, and bail if it takes too long. Be forewarned this could leave scarce resources hooked (e.g., db connections, etc), but you can fix this too.
(sorry for the quick and dirty code, it’s for demo, you should elaborate and add types, webservice specifics, etc.)