collective / Products.EasyNewsletter

Powerful newsletter/mailing product for Plone.
https://pythonhosted.org/Products.EasyNewsletter/
GNU General Public License v2.0
28 stars 23 forks source link

Why collective.taskqueue? #148

Closed datakurre closed 4 years ago

datakurre commented 4 years ago

@MrTango I was surprised to to see "asynchronous sendout" using collective.taskqueue. Does it do something that just using asynchronous queuing feature of Products.MailHost does not?

https://pypi.org/project/Products.MailHost/

(That said, I have no idea, if MailHost queue works any better than taskqueue [it does not] with WSGI. I assume it needs a separate zope.sendmail daemon to be run to send the created queue from disk.)

agitator commented 4 years ago

@datakurre problem was that collecting all the users and preparing personalized email for 3000+ recipients took quite some time and the risk that the newsletter editor would do something "dangerous" was too big. Also there were timeouts on nginx which looked like an error and editors were tempted to resend the same newsletter... So we decoupled the preparation of the sendout into a separate job.

datakurre commented 4 years ago

@agitator Thanks. So, there was much more that just sending email. 👍

MrTango commented 4 years ago

I'm working already on a dramatiq based version, for WSGI. But it's plugable anyway ;)

datakurre commented 4 years ago

Nice. Broker connections are always tricky. Probably even more so with WSGI. And two phase commit should somehow to be taken account so that connections is tested during the first phase so that the second phase could no longer fail... Interest to see how it works out. I'm probably thinking in too complex :)