如何以异步方式下asp.net运行持久的过程? [英] How to run long-lasting process asynchronously under asp.net?

查看:244
本文介绍了如何以异步方式下asp.net运行持久的过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET 4.5,asp.net mvc的:什么是从ASP.NET应用程序中运行持久的过程(1-2分钟),给它应该在单线程环境中运行的最佳方式,我指的是过程启动一个用户在同一时间只,处决所有其他用户必须等待,直到当前执行的呢?该方案是以下内容:用户点击按钮运行某种持久的计算,http响应立即返回给用户,然后用户必须请求计算用手动单独的请求的状态。 Asp.net HTTP会话流产不应该导致进程终止,应该继续下去。该过程可能被相同或不同的服务器上运行。

.net 4.5, asp.net mvc: What is the best way to run long-lasting process (1-2 minutes) from ASP.NET application giving it should be run in a single-threaded environment, I mean the process is initiated for one user at a time only, executions for all other users have to wait till the current execution is done? The scenario is the following: user clicks button that run some sort of long-lasting calculations, http response returned to the user immediately, then user has to request status of the calculations with separate request manually. Asp.net http session abortion should not lead to the process termination, it should keep going. The process might be run on the same or separate server.

推荐答案

我会使用某产品时建议,如 NServiceBus 卸载的处理和在单线程模式下运行。这个的好处是,所有的请求都会按顺序处理,并且处理可以从Web服务器被卸载,你真的不希望长时间运行的进程发生在Web服务器上。

I would suggest using a product such as NServiceBus to offload the processing and run it in single threaded mode. The advantage to this is that all requests will be processed in order and the processing can be offloaded from the web server as you don't really want long running processes to happen on a web server.

这篇关于如何以异步方式下asp.net运行持久的过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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