I've been toying around with doing one of these projects yet I've never sat
down and actually done it.  But here's the method I would use:

Create an event class which does nothing but hold a queue of events and has a
single thread which sends out reminders.  Every time you receive from an
interface like a web form, pass it to the event class which adds it to the
queue.  If it's the most recent event, have the thread sleep until the event.
The only time the thread wakes up is after the specified period in which it
sends the reminder and then sleeps until the next event or if a new event is
added which is sooner than the current one in this case you would just wake up
the thread and put it back to sleep with a new value.

This way you never have wasted calls which we call programmable interrupts.
About the least efficient way you can do things.

Of course you will probably want to add a bit of stability methods which save
the current queue to a database or a file as every 10 or so events are added in
case the server crashes.  As well as other stuff...

~Matt


Quoting Jeff Miller <[EMAIL PROTECTED]>:

> I think that I would periodically (every 15 mins) create a queue of the
> pending reminders for the next interval in order they occur and then
> every minute, examine the top entry and compare it with the current
> time, and, if necessary, pop the reminder off and send it.  This way
> you're only hitting the database every 15 minutes and the queue would be
> in memory.  Hope this helps.
>
>         -----Original Message-----
> From: [EMAIL PROTECTED]
> Sent: Wednesday, May 16, 2001 9:27 AM
> To: <[EMAIL PROTECTED]>
> Subject: Re: Reminders for web based Calendar
>
>
>
>         I have to give reminder to his email or a Mobile...so
> I basically should be having a Calendar server running
> which can keep track of all these reminders...
> Lets take a case :
> User wants a reminder on Wednesday 5.30 pm about
> something....and he sets the reminder today....
> so the Calendar server should be checking the database
> ..lets say every one minute
> but that will be too much...so what are the other
> techniques???
>
>         Please help...this is really urgent
>
>
>         Purav
>
>             Michael Weller <[EMAIL PROTECTED]> wrote:
> > you could write a standalone application running on
> > any client. This
> > application opens up a connection (every hour, every
> > ten minutes, whatever)
> > to a servlet to find out if there is there is
> > something to be reminded of,
> > and if so, the application opens a browser window
> > requesting the servlet to
> > display the reminder for that user. The problem is
> > that every user of your
> > calendar needs to install that client...
> >
> >  mw
> >
> > At 18:13 16.05.2001 +0530, you wrote:
> > >Hello Guys,,
> > >
> > >I am developing a web based Calendar..
> > >any idea how do you acheive sending reminders for
> > particular date....
> > >I guess you need a Calendar server running
> > behind...or is there any other
> > >way,...
> > >
> > >Otherwise everything works ok using
> > jsp/servlet/beans
> > >
> > >Please Help. This is Urgent
> > >
> > >Outgoing mail is certified Virus Free.
> > >Checked by AVG anti virus system
> > ( http://www.grisoft.com).
> > >Version: 6.0.252 / Virus Database: 125   Release
> > Date: 5/9/01
> > >
> >
> >___________________________________________________________________________
> > >To unsubscribe, send email to [EMAIL PROTECTED]
> > and include in the body
> > >of the message "signoff SERVLET INTEREST".
> > >
> > >Archives:
> >
> http://archives.java.sun.com/archives/servlet interest.html
> > >Resources:
> >
> http://java.sun.com/products/servlet/external resources.html
> > >LISTSERV Help:
> > http://www.lsoft.com/manuals/user/user.html
> >
> >
> ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > and include in the body
> > of the message "signoff SERVLET INTEREST".
> >
> > Archives:
> >
> http://archives.java.sun.com/archives/servlet interest.html
> > Resources:
> >
> http://java.sun.com/products/servlet/external resources.html
> > LISTSERV Help:
> http://www.lsoft.com/manuals/user/user.html
>
>
>         __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions   buy the things you want at great prices
> http://auctions.yahoo.com/
>
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET INTEREST".
>
>         Archives: http://archives.java.sun.com/archives/servlet
> interest.html
> Resources: http://java.sun.com/products/servlet/external resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to