Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. But is this even possible?

The MVC4 website is a sort of notifying system. Other websites can register a Callback URL on this website and this website should trigger that callback URL for a specified interval. 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. So it can do its checks and make an HTTP call when necessary.

It's important though that other websites can register their own Callback url through an http web request, and not through a socket.

Is something like this possible in an ASP.NET MVC web application? Or do I need a different approach?

like image 396
w00 Avatar asked Nov 18 '25 16:11

w00


2 Answers

Check this out: Easy Background Tasks in ASP.NET MVC

like image 78
Roman Pushkin Avatar answered Nov 20 '25 08:11

Roman Pushkin


I do not prefer to run continuous jobs in asp.net because of these reasons.

  • You can use Windows Azure Scheduler for scheduling http requests for a particular URL.
  • Alternatively you can create a Windows service (example here)
  • You can also try console app and schedule it using Windows task schedule
  • Azure Worker Role is also a good option
like image 44
ramiramilu Avatar answered Nov 20 '25 07:11

ramiramilu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!