Skip to content
tra edited this page Sep 12, 2010 · 6 revisions

In case you’re wondering, this is the very same plugin that’s also hosted on RubyForge. The purpose of this plugin is to provide a dead-simple way to fork (or thread) off a long-running section of code so that your application can get on with the task of serving the user. Here’s an example:


  spawn do
    do_some_heavy_processing_thing
  end

Spawn knows how to handle database connections so that your spawn block and the main program each will access your database with a different connection. Basically that’s all there is to it but if you want to know more suggest you peruse the README file for all the details.

Clone this wiki locally