Attached sample shows how to use Azure Storage Queues to schedule processing of an item for a later point in time. It solves a common problem of scaling out a process based on iterating over a collection and processing some items based on time specific properties. Such an iteration, while easy enough to implement in a single process becomes difficult when implemented in multiple parallel processes. Using Azure Storage Queues (Azure Service Bus Queues have similar facilities) one can create messages which can only be accessed at a specific future point in time (within 7 days for Azure Queues). This way multiple processes reading the queue can execute in parallel in a time-based sequence.
The sample consists of two console projects: a sender and a receiver. The sender creates 10 messages scheduled for processing with up to 10 minutes delay, randomly distributed among the messages. After the messages are sent, they are listed in the sequence they should be received. The second projects runs an endless loop waiting for messages and displays them in the sequence they arrive. The two displays should match (mostly: Azure Storage Queue, unlike ServiceBus queues do not guarantee sequence of delivery).