[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stuff to work on
From: |
Jan-Henrik Haukeland |
Subject: |
Re: stuff to work on |
Date: |
Fri, 06 Feb 2004 03:14:26 +0100 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, linux) |
Martin Pala <address@hidden> writes:
> My priority list:
>
> 1.) SMTP update (message queue + state machine)
> 2.) "up" event (ability to notice the bidirectional state transtition)
If you take only one of these it would be great. Especially item 2 has
been requested by a few. Item 1, refactoring the SMTP protocol
implementation in sendmail() to use a proper state-machine and
implementing a mail queue is going to be a big job, but it will
probably be fun and a challenge to implement :-)
> What do you think about it?
I think the plan sounds good, also if we are going to maintain a queue
of mail messages it will probably require that sendmail() runs in its
own thread (because it can take time to process the queue).
put mail() --> [mail-queue] -> sendmail-thread(read-&-send-mail)
You will need to create a work-queue where the alert handler put mail
into a mail queue and sendmail() reads and process mail from the
queue. If the queue is empty the sendmail() thread sleeps on a
condition variable.
Maybe you can use this code for inspiration?
http://www.awprofessional.com/catalog/product.asp?product_id={EE21FAD5-7848-4B87-AE8E-A3340E1DD09D}
Under the Source Code link, check: workq.c workq.h workq_main.c. The
URLs are ridiculous long so I don't pass them here.
Ps. we should probably take the details of the implementation down to
the monit-developer mailing list.
--
Jan-Henrik Haukeland