How to implement background processing for ASP.Net MVC website in a shared hosting environment?

前端 未结 4 1104
旧时难觅i
旧时难觅i 2021-02-01 08:45

I am developing my first web application using ASP.Net MVC, and I am in a situation where I would like a background service to process status notifications outside of the applic

相关标签:
4条回答
  • 2021-02-01 08:54

    If only one background task is enough for you then use the WebBackgrounder And this is the article with detailed explanation.

    0 讨论(0)
  • 2021-02-01 09:01

    To answer whether GoDaddy will support a seperate service you need to ask them.

    However there are a number of creative ways that you can "get around" this issue on shared hosting.

    1. Have a secure page that's purpose is to execute your background work. You could have scheduled task on a machine under your control that calls to this web page at set intervals.
    2. Use a variation of the Background Worker Thread answer from @safi. Your background worker thread could check to see if another is already processing and stop, so that only one instance is running at a time.
    0 讨论(0)
  • 2021-02-01 09:05

    also take a look at this Simulate a Windows Service using ASP.NET to run scheduled jobs article.

    it explains a nice way to schedule operations with no outer dependence.

    The idea is to use Cache timeout to control the schedule. I've implemented it successfully on a project which required regular temp file cleaning. This cleaning is a bit heavy so we move this clean operation in a scheduled job (using the asp.net cache) to avoid having to deploy scheduled task or custom program.

    0 讨论(0)
  • 2021-02-01 09:10

    Have you tried with quartz.net? I think it may fit your needs.

    0 讨论(0)
提交回复
热议问题