如何做到异步/独立处理网页的请求? [英] How to do asynchronous/independent handling of webpage request?

查看:118
本文介绍了如何做到异步/独立处理网页的请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待生成一组图片作为ASP.net网页上提交表单的用户的结果。还有一个风险,即服务器将请求,所以我在寻找的图像生成移交给一个独立的过程,不产生和电子邮件时,他们已经准备好下载用户以某种方式被重载。理想的是,单独的进程将被连续运行,以便它可以迅速响应请求。

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.

任何想法用在这里是什么?需要将.NET。

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

干杯,伊恩。

推荐答案

我想创建一个Java Servlet和一些类将处理后台作业的石英调度。

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.

您可以再拥有JavaScript客户端不时问时间(每隔10秒左右),如果作业完成,如果是这样,返回的URL的图片。

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.

这篇关于如何做到异步/独立处理网页的请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆