I have a case where I need to validate the values coming in, post them to the database, then return a success or failure to the end user.
I then need to continue processing some long running things that need to happen out of band (sending email, sms messages etc.) as a result of the API call (It's a post in this case)
Is there a way to to do this that is both scalable and doesn't kill the thread of the request without resorting to hacking another endpoint and calling it and not caring about the result?
There's lots of threads saying this won't work because it will be killed as soon as the request is completed processing. I figured it would be even worse for Web API?
John Galt
Member
30 Points
47 Posts
Return a result then continue processing additional operations
Nov 29, 2012 06:49 PM|LINK
I have a case where I need to validate the values coming in, post them to the database, then return a success or failure to the end user.
I then need to continue processing some long running things that need to happen out of band (sending email, sms messages etc.) as a result of the API call (It's a post in this case)
Is there a way to to do this that is both scalable and doesn't kill the thread of the request without resorting to hacking another endpoint and calling it and not caring about the result?
pratik_galor...
Participant
1483 Points
330 Posts
Re: Return a result then continue processing additional operations
Nov 30, 2012 04:35 AM|LINK
Could not get ur requirement completely, but it seems like you want to do tasks asynchronously like sending mails and messages,
well you have to create thread processes for that.
I have already given solution here, check it out:
http://forums.asp.net/t/1779595.aspx/1?Email+sending+code+takes+much+time
Software Engineer,
iGATE Global Solutions.
pratik_galoria@yahoo.co.in
+91-8905195943
John Galt
Member
30 Points
47 Posts
Re: Return a result then continue processing additional operations
Nov 30, 2012 06:03 PM|LINK
Thanks!
There's lots of threads saying this won't work because it will be killed as soon as the request is completed processing. I figured it would be even worse for Web API?