问题
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.
回答1:
You need to use a scheduled task. There are two good libraries out there that you could use: Quartz.Net and Castle scheduler.
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.
I've used Quartz.net in an azure webrole successfully in a production app.
来源:https://stackoverflow.com/questions/4824193/azure-queueing-time-based-tasks