Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A better way of calling a block later on is to use the web-server-agnostic run_later method. This method places the block into the worker queue and has it run at some point after the response is handled. We can use this extensively once again for time-intensive instructions that are not necessary for the controller response. Also, because run_later is essentially just a means of pushing blocks into a queue, we can have as many of them as we like.
class Example < Merb::Controller def index run_later do sleep 10 end "hi" end