How to do asynchronous/independent handling of web

2019-03-05 12:20发布

I'm looking to generate a set of images as a result of a user submitting a form on an ASP.net web page. There's a risk that the server will be overloaded with requests so I'm looking for some way of handing off the image generation to a separate process which does the generation and emails the user when they're ready for download. Ideally the separate process would be continuously running so that it can respond to requests promptly.

Any ideas what to use here? Needs to be .net.

Cheers, Ian.

1条回答
走好不送
2楼-- · 2019-03-05 13:23

I would create a Java Servlet and some class with a quartz scheduler that will handle the background jobs.

If a user submits the form you can create the background jobs, quartz will then handle the queuing and processing of those jobs.

You could then have the JavaScript client ask from time to time (every 10 seconds or so) if the jobs are finished and if so, return the urls to the pictures.

查看更多
登录 后发表回答