pipedream : fork a dtml-method within zope ?
Consider a discussion forum product where a dozen people have already participated in a particular thread. These people, when posting their messages, checked a box which said "email me when somebody else responds/adds to this thread". (Yes, this is nicked from Cold Fusion Forums :-) Now, a 13th person adds his 2 cents to the thread and posts a response. We want to now send a mail to each of the first 12 participants. No problem so far, except mailing all 12 people is going to take quite a bit of time, and contributor #13 is going to get impatient waiting whilst this is happening. Then imagine a discussion thread with dozens of participants/posts. Solutions : a. Write some script to go through the discussion forums looking for such follow ups and mail the previous participants in the discussion thread. Cronjob it. Tiresome/boring and not as instantaneous as I'd like. b. Is it possible in any way to fork that mailing process (which is actually just one dtml method), so that it can be completed without slowing down the rendering of the page ? I'm guessing this is totally beyond zope. Or am I overlooking something obvious ? TIA, Chas
On Thu, 27 Jan 2000 01:41:16 +0800, chas <panda@skinnyhippo.com> wrote:
b. Is it possible in any way to fork that mailing process (which is actually just one dtml method), so that it can be completed without slowing down the rendering of the page ? I'm guessing this is totally beyond zope.
You can do this in an External Method Toby Dickenson tdickenson@geminidataloggers.com
Thanks for the reply last week and sorry for my late follow up - my ISP sucks.
b. Is it possible in any way to fork that mailing process (which is actually just one dtml method), so that it can be completed without slowing down the rendering of the page ? I'm guessing this is totally beyond zope.
You can do this in an External Method
Yes, but External methods still have to be fully executed before the page is returned/rendered, if I'm not mistaken. Unless you're suggesting I use a multi-threaded python script in the external method. But then I'd lose all the ease-of-use of Zope's MailHost and ZSQL features. Yeah, I guess I want to have my cake and eat it. Actually, what I was looking for is the Zope equivalent of DELAYED_INSERT in MySQL which causes (time-consuming) inserts to be delayed, allowing the program that requests them to return flow control much faster. Thanks also to Anthony Baxter (once again) for his suggestions :
How about something like 'write the message and the recipients to a database table, then have something poll that table.'
Nice idea if I do have to resort to a cronjob - saves having to backtrack through all of the forums/discussions.
Or have a local mailer set up to receive messages for delivery immediately, and point Zope at that - actually formatting up the message for delivery shouldn't take that long (particularly if it's the same message - you format it once, send it 12 times.)
Perhaps - I've just not been overly impressed with the speed of any forms that send mail (and it's a local mailserver, residing on the webserver) .... I will have to benchmark the speeds for long threads (with up to 40 participants to be e-mailed). Thanks for your help, chas
participants (2)
-
chas -
Toby Dickenson