Azure的任务计划 [英] Azure Task Scheduler

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

问题描述

虽然这个问题是特别Azure的,我敢肯定这是一般的云计算常见的情况。

While this question is particular to Azure, I'm sure that it is a common situation for cloud computing in general.

我有我需要在特定时间运行的任务列表。随着窗口的服务器,我可以使用任务计划,并安排我的计划,在特定时间运行。我可以走得更远了一步,创造条件,在一个给定的时间间隔运行一个Windows服务,然后执行相应的任务。

I have a list of tasks that I need run at a certain time. With a window's server, I can use Task Scheduler and schedule my program to run at a certain time. I could go a step further and create a windows service that would run at a given interval and then execute the appropriate task.

有没有人有最好的方法的建议是一个云计算环境?

Does anyone have a suggestion on the best approach is for a cloud computing environment?

我可以创建一个辅助角色轮询任务列表每一秒,然后抛出适当的任务到由另一个工作者角色处理的队列中。

I could create a worker role that polls the task list every second and then throws the appropriate task into a queue that is processed by another worker role.

我可以创建一个能够每天运行一次辅助角色,抓住所有的任务,并提交给一个队列。然后该处理器的角色将在适当的时候拉断队列和处理的一个项目。

I could create a worker role that would run once a day, grab all the tasks and submit them to a queue. The processor roles would then pull an item off the queue and process at the appropriate time.

任何其他建议?

推荐答案

您可以设置一个服务总线队列和使用,作为调度。

You can set up a Service Bus Queue and use that as the scheduler.

将消息发送到队列中通过设置<一个href=\"http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.brokeredmessage.scheduledenqueuetimeutc.aspx\">ScheduledEnqueueTimeUtc上的消息到所需的时间和该消息将在此时的队列中显示。在执行工人/ Web角色设置了一个接收器上的队列,然后将尽快得到这份工作的消息出现,即工作是因为

Send messages into the queue by setting ScheduledEnqueueTimeUtc on the message to the desired time and the message will show up in the queue at that time. In the executing worker/web role you set up a receiver on that queue and that will then get the job as soon as the message shows up, i.e. the job is due.

有关的好处是,你可以用它来在多个实例平衡工作,因为定时器是完全外在于你的应用程序,你不必存储和复活和管理。 SB做所有你们。

The nice thing about that is that you can use this to balances jobs across multiple instances and since the timer is completely external to your app you don't have to store and resurrect and manage it. SB does all that for you.

一个警告:SB不必设施取消预定的消息

One caveat: SB doesn't have facility to cancel scheduled messages.

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

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