views:

112

answers:

3

I am looking to build a web application that will allow users to manage simple tasks or todos. As part of this, I'd like to send users email reminders daily of their tasks. I'd like each user in the system to specify what time of day they get their reminder, though. For example, one user can specify to get their emails at 8AM while another user might choose to get their emails at 7PM. Using .Net, what is the best way to architect and build this "reminder" service? Also, as a future phase to this, I'd like to expand the reminders to SMS text and/or other forms of notification.

Any guidance would be appreciated.

A: 

I would create a service that runs all the time and checks once a minute for task to preform. You could then preform what ever actions you need. you can create a website for users to use that goes to a database that the service also reads off of. If you want to get a little more fancy and a WCF interface to your service have the website go to the service and store your needed reminders in the database.

rerun
+1  A: 

Your question is a little broad, but there are two general approaches to handling reoccurring tasks on Windows:

  • Write a service, and design it to check for tasks periodically. You might have it poll a database every quantum, and execute any reminders due at that time (marking off those it's completed).
  • Run a program as a Windows scheduled task (the Microsoft equivalent of cron). Run it every hour, and check a database as above.

I'm assuming you know how to send email from .NET - that's pretty straightforward, and most carriers have mail-to-SMS gateways.

Michael Petrotta
A: 

I suppose you could do it two ways:

  • Windows Service running in the background, which polls the DB, looks for items at the current time, sleeps if it finds nothing, loops

    This is fine enough, but may not scale well if suddenly there are 1,000s of items to process in 30 seconds, or so, as it will take too long to do it. You can get around this by building it with MSMQ in mind, which allows distribution over different machines, and so on.

  • Similar Windows Service, but have it interactable via some sort of pulse/wait system, which is fired each time a new DB entry gets made. Then it can legitimately sleep, but is kind of "brittle".

I'd probably go with the first approach.

Noon Silk