Re: sendmail in 1 millisecond
by brian_d_foy (Abbot) on Aug 15, 2005 at 07:14 UTC
|
If you want your Perl program to spend less time sending mail, you have to let someone else spend the time doing it. That's what's happening when you let sendmail figure it all out. It's not sending the mail in a millisecond. It's queueing the mail in that long, after which your Perl program gets control again. sendmail does more work on its own.
--
brian d foy <brian@stonehenge.com>
| [reply] |
|
Of course brian is right ... you're going to have to work with the sendmail admin to ensure you have your local sendmail daemon configured correctly to support the queueing. Once that's done, you can use the -odd option to sendmail for the quickest async operation (all database lookups (DNS) are deferred until the queue is run). The
downside to this approach is normally delayed delivery. It may take some time for the queue to be processed and hence your mail delivered.
| [reply] |
Re: sendmail in 1 millisecond
by merlyn (Sage) on Aug 15, 2005 at 07:48 UTC
|
1 millisecond (0.0017 secs)
Admittedly, I've been up for about 22 hours, but unless my math is completely bonkers, "one millisecond" is "0.001 seconds".
| [reply] |
Re: sendmail in 1 millisecond
by astroboy (Chaplain) on Aug 15, 2005 at 09:28 UTC
|
Out of curiosity - what's the rush? | [reply] |
|
Are you serious! What do you mean, "what's the rush"! Have you NEVER waited for sendmail to send mail? That 0.017 seconds is torture, it's like waiting at the Department of Motor Vehicles to renew your driver's license. All of that wasted time just spent waiting, waiting, waiting, just to send an email, it's enough to make a programmer go nuts!
Joking, of course.
-Bryan
| [reply] |
|
| [reply] |
|
With heartfelt apologies to both Hormel and Monty Python, could the answer to your question lie here?
Jack
| [reply] |
|
Well I suspect that it does, but I didn't want to start casting aspersions
| [reply] |
Re: sendmail in 1 millisecond
by Roger (Parson) on Aug 15, 2005 at 08:11 UTC
|
Network related operations (such as Email) are asynchronous, they should be handled asynchronously. Well, you can fork() a child process (or lots of child processes), and let each of them handle a sendmail request, and your main process can carry on doing other stuff.
There are a few examples here in the monastery that does what I described above. Check out the multi-threaded network ping example. Well, you have to search the monastery for the code, I am not going to provide the link here.
| [reply] |
Re: sendmail in 1 millisecond
by holli (Abbot) on Aug 15, 2005 at 07:11 UTC
|
Give me your email address. I'll send you the (ahemm) solution.
| [reply] |
Re: sendmail in 1 millisecond
by fauria (Deacon) on Aug 15, 2005 at 14:45 UTC
|
use Time::Machine;
read(this); | [reply] |