I开发者_运维技巧 would like to make an emailing in my symfony project.
The user admin log-in in the backend and click on the button "start emailing", then 8000 emails is sending (2 per second). The admin user can close his page and go back a few moment later to see the emailing's progression. (10%...., then 20%... etc).
How can i do ? I think a have to use CRON TASK, but i'm not sure... Maybe there is a better/other solution ?
Can you explain me the best way to program my emailing ?
Thanks, and sorry for my english!
The best way to rate the sending would be setting your MTA to do that for you. If it's a application requirement then go for Gearman. There is this awesome wrapper for the PHP interface (http://www.symfony-project.org/plugins/sfGearmanPlugin). It works really well.
Cron tasks do not know if the previous running instance has finished the job. It really messes thing easily up. For those cases, like yours, that you need to back processing, the best choice is a solution like Gearman.
精彩评论