The Rails Wiki lists all possibilities -
http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails

The most simple (and low-level) solution I found was to use  script/
runner
(from 
http://www.ahabman.com/blog/2008/05/rails-background-process-simple-fast-easy/)

My_Controller

  def in_background
    # your normal code here

    system " RAILS_ENV=#{RAILS_ENV}   ruby  #{RAILS_ROOT}/script/
runner   'MyModel.some_method_to_run_in_background'  & ”

  end

end



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to