Topic: Separate threads for emailing and such

Hello all,

Is it possible to spawn the ActionMailer actions in a different thread so my web application doesn't wait for the email to be sent before rendering the next page?  I'm not only wanting to do this with emails, but with PDF generation as well (PDF will be saved to file after a new create and be available via a separate link rather than sending the data to the user directly).

--
Thanks!
Bryan

Re: Separate threads for emailing and such

Can anyone help me out on this?  I've tried creating a new thread to generate the PDF's in, but since I have to 'join' the thread, the main program (Rails I presume...) still has to wait for the thread to finish before moving on.

--
Bryan

Re: Separate threads for emailing and such

maybe this is useful, just came across it, not tested but looks promissing to easily move portions of code to the background:
http://opensource.imedo.de/pages/show/background

Re: Separate threads for emailing and such

Hi Duplex,

Thanks for the suggestion.  I started testing out Spawn (http://spawn.rubyforge.org/svn/spawn/README) just a few minutes ago... seems to work pretty well.  How do you think it compares to Background?

--
Bryan