简体   繁体   English

使后台进程在MVC4网站上连续运行

[英]Have a background process running continously on an MVC4 website

I have an ASP.NET MVC4 website running and now i need some sort of background task that is continously running. 我有一个正在运行的ASP.NET MVC4网站,现在我需要某种不断运行的后台任务。 But is this even possible? 但这有可能吗?

The MVC4 website is a sort of notifying system. MVC4网站是一种通知系统。 Other websites can register a Callback URL on this website and this website should trigger that callback URL for a specified interval. 其他网站可以在该网站上注册Callback URL,并且该网站应在指定的间隔内触发该回调URL。 So, for every hour for example. 因此,例如每小时。

Normally the code of my website only becomes active when I visit a page. 通常,我的网站代码仅在访问页面时才处于活动状态。 But in order to make this work I need a way to have my ASP.NET website to run in the background continously. 但是为了使这项工作有效,我需要一种使ASP.NET网站连续在后台运行的方法。 So it can do its checks and make an HTTP call when necessary. 因此,它可以进行检查并在必要时进行HTTP调用。

It's important though that other websites can register their own Callback url through an http web request, and not through a socket. 重要的是,其他网站可以通过http网络请求(而不是通过套接字)注册自己的Callback URL。

Is something like this possible in an ASP.NET MVC web application? 在ASP.NET MVC Web应用程序中是否可能发生这种情况? Or do I need a different approach? 还是我需要其他方法?

I do not prefer to run continuous jobs in asp.net because of these reasons . 由于这些原因,我不希望在asp.net中运行连续作业。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM