mvc和预定任务 [英] mvc and scheduled tasks

查看:104
本文介绍了mvc和预定任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi


只是想知道如何使用MVC应用程序完成任务调度。有一些像hangfire和fluentscheduler这样的软件包来处理调度任务,现在最好将这些软件包放在他们自己的网络应用程序中,还是让它们驻留在主要的Web应用程序中?



所以说发送/接收邮件,主应用程序可以向数据库写一条消息,计划任务将从一个单独的Web应用程序批量发送这些消息。

解决方案

错误。并非所有问题都通过网络应用程序解决。



计划任务是在设定时间运行的某个过程。大多数计划任务实际上只是执行工作然后退出的控制台应用程序。



Web应用程序仅在Web请求进入时执行,而不是在计划表上执行。这就是为什么网络应用不是预定任务的好选择。


Hi
just wondering about what best to do with task scheduling with an MVC app. There are packages like hangfire and fluentscheduler that handle scheduling tasks, now would it be best to put use these packages in their own web app or let it reside within the main web app?

So say sending/receiving mail, the main app can write a message to the database and the scheduled task will send these messages in batch from a seperate web app.

解决方案

Wrong. Not every problem is solved with a "web app".

A scheduled task is some process that runs at a set time. Most "scheduled tasks" are really just console applications that do a job and then quit.

A web application only executes when a web request comes in, NOT ON A SCHEDULE. This is why a "web app" is not a good choice for a "scheduled task".


这篇关于mvc和预定任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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