天青 - 排队基于时间的任务 [英] Azure - queueing time based tasks
问题描述
我的应用程序处理来自用户(后者又被放入一个队列的Azure)传入的请求,并将它们分配到真实世界的人。
My application that runs on Windows Azure processes incoming requests from a user (which are put into an Azure Queue) and assigns them to real-world people.
的人有一定量的时间来处理该请求。如果没有指定的人处理请求,我需要移动到一套新的人。基本上,我要排队这些任务在一定的时间来进行处理,然后再次处理它们。如果其中一个用户处理的任务,我需要它离队所以它不是由工人再处理。
The people have a certain amount of time to handle the request. If none of the people assigned handle the request, I need to move on to a new set of people. Basically, I want to queue these tasks to be handled at a certain time, and then handle them again. If one of the users handles the task, I need to dequeue it so it isn't handled again by the worker.
推荐答案
您需要使用计划任务。有两个很好的图书馆,在那里,你可以使用:
Quartz.Net 并
城堡调度。
You need to use a scheduled task. There are two good libraries out there that you could use: Quartz.Net and Castle scheduler.
随着scheduledler,这样的任务变得容易。
你刚才创建的处理时间到期时运行工作。在那里,你会检查任何未处理的请求,如果有任何左,你通知下一组的人,并设置另一个计划开始火处理时间到期后。
With a scheduledler, such a task becomes easy. You just create a job that runs when the processing time expires. There you would check for any unprocessed requests and if there are any left, you notify the next set of people and set another scheduled start to fire after processing time expires.
让我知道如果你需要进一步的细节。
Let me know if you need further detail.
我用Quartz.net在蔚蓝webrole成功地在生产应用程序。
I've used Quartz.net in an azure webrole successfully in a production app.
这篇关于天青 - 排队基于时间的任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!