List Info

Thread: RE: Sending email from Catalyst and scripts




RE: Sending email from Catalyst and scripts
country flaguser name
United Kingdom
2007-05-23 05:33:43
Exactly; sending the email in end() after the page has been
sent off would
not delay the page loading...

Mark


_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: Sending email from Catalyst and scripts
country flaguser name
United Kingdom
2007-05-23 06:11:29
mark wrote:
> Exactly; sending the email in end() after the page has
been sent off would
> not delay the page loading...
> 
> Mark
> 

Except that end is before the page has been sent back to the
browser.

You would need some kind of hook in what ever engine you are
using to 
support that. Not a bad idea mind, but I dont think anything
exists 
currently.

-ash

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: Sending email from Catalyst and scripts
country flaguser name
United States
2007-05-23 10:23:04
On Wed, 23 May 2007, Ash Berlin wrote:

> mark wrote:
>> Exactly; sending the email in end() after the page
has been sent off would
>> not delay the page loading...
>> 
>> Mark
>> 
>
> Except that end is before the page has been sent back
to the browser.
>
> You would need some kind of hook in what ever engine
you are using to support 
> that. Not a bad idea mind, but I dont think anything
exists currently.

You can do this sort of thing with mod_perl via
$r->register_cleanup() 
(mp1). I'm sure there's a similar mp2 API, but I can't
recall what it is.

The cleanup phase in mod_perl runs after output is sent to
the client. 
Providing something similar for other Catalyst engines would
be pretty 
cool.

Of course, if you're sending lots and lots of email, you're
better off 
with an external queue, maybe processed via a daemon or
cron. You don't 
want to tie up "expensive" app server processes
sending email when they 
could be serving the next client.


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )