My fellow prepared some data at front-end.He insert our customers' info into DB (say :msg_DB)
.
The frequency is about 30 items per minute.
Then i need to take the data that he insertd into msg_DB, compose of them with customized HTML template.
Subsequently,I send the data to our customers by SMTP server (At the same time,i mark the corresponding costomers'
info in msg_DB to "already sent").
Now the problem is my program is slower than my fellow insert into the msg_DB . As a result,our customers will
wait for a long time to recive their mail!
My program is a deamon.The Pseudocode is :
What's about this method? Whether or not i need use multi-thread process to speed my program ? Pls make suggestions to me:)while (1) { $sth = $dbh->prepare(qq{select * from customers where mark=0}) +; $sth->execute() or die "$DBI::errstr\n"; while ($sth->fetch) { my $content = construct_the_customers_template(); send_customer_mail($coutnet); mark_the_flag_in_msgdb(); # set the mark field to 1 ,repr +esent has sent! } }
Regards,
pysome
In reply to how to speed the mail process? by pysome
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |