Observers and Callbacks on Rails models operate on the same thread and block the request until they return.
For example, if I have a Photo model and I queue a resizing job in the after_create callback or observer, the request doesn't finish until an entry is made in the queue (which can sometimes be slow if I am using Amazon SQS for queuing).
Same holds true for Callbacks on Rails controllers. If I have to run maintenance like cache management or store analytics the request doesn't finish until the callback ends.
Is there a Rails way to run the code inside a callback (Model or Controller) or observer in a different thread so the request isn't stalled?