[Dancer-users] do something after sending response
David Precious
davidp at preshweb.co.uk
Thu Aug 11 19:17:47 CEST 2011
On Thursday 11 August 2011 18:00:37 Brian E. Lozier wrote:
> I think you're better off having another server-side process to do
> this. For example, your dancer app adds a row to an "email_queue"
> table and then you have a cron job on the back end that looks for new
> rows and sends out the emails. This way it's decoupled from your
> application code. It's also easier to manage logs and notifications
> when you're not doing it under a web server environment.
I'd tend to agree, that sounds like a sensible way to handle it.
Another possible alternative would be to fork a new process that will do the
stuff in the background, whilst the original process continues onwards to send
the response back to the client.
That might be a little trickier and harder to debug, though, possibly.
--
David Precious ("bigpresh")
http://www.preshweb.co.uk/
"Programming is like sex. One mistake and you have to support
it for the rest of your life". (Michael Sinz)
More information about the Dancer-users
mailing list