Best way to perform lengthy operations?


What is the best way to handle lengthy operations with Rails (lengthy in
this case could be a minute or even more)? I want to give response to
the user about what is happening so I guess polling the server with ajax
is one way to get data to the browser.

But what do I do with the lengthy operation? I mean, the best as I see
it would be to make the first request (the one that triggers the lengthy
operation) asynch and that I somehow spawn a new thread, calls another
ruby process or something that performs the operation and the other
thread/process updates the database that the UI can use to provide data
to the user.

How would you go about doing this? Would you do it differently? Is there
some fantastic thing built into Rails to handle things like these? A
marvelous plugin maybe?