views:

70

answers:

1

I have the following situation: I have a few hundred resources at my disposal (PCs/mobiles/smart devices). I would like to make a networked lab out of these where users can request access to some or all of these devices starting at a particular time. I'm writing a scheduler for this purpose. At the requested time, I wish to inform the user that the request has been granted, and then do some tests on the devices automatically. I'm just wondering what would be an efficient way to write the scheduler. As of now, I thought of the following:

  1. Whenever a request comes in, I put it in an SQL database table. I write a program to keep checking this table for jobs that are due and run them. This would be periodic (say every 5 minutes), so I cannot schedule immediate tests.

  2. Keep a job object for each job, and attach a timer that fires at the specified time (seems to be the least scalable).

  3. A hybrid of (1) and (2). I create job objects with timers by querying the database at a larger interval (say 30 minutes). In the query, I fetch all jobs that are due in the next 30 minutes or so.

Is there a better/cleaner way to do this?

Thanks a lot for the responses in advance!

+1  A: 

Have you tried Quartz.net...i have used Quartz java flavour for quite some time and am impressed with what it does for me.

Wow! This looks awesome. Thanks a lot user10398!
Andy