One approach you could consider is to maintain some record of tasks,
such as in a database. Then the Ramaze app's responsibility is merely
to insert tasks into a queue, and something else would be responsible
for picking up queued jobs, and doing the work. That could be a
daemon, or a cronjob. That would let your Ramaze app return
immediately, and you could have a controller action for listing
pending jobs, etc.
The external daemon would be responsible for synchronization and
process/thread safety. You could choose to execute jobs only
serially, for example.
Pistos