Berlin Brown wrote:
> A lot of applications have a middleware layer.  In some ways,
> ActiveRecord or Mailer is thought of as a middleware.
> 
> But, for example with J2EE, you can run background servers and threads.
>  Can this be done with Ruby and how?
> 

I take the code I need to run separate from rails and set it up as a system daemon. I put all of these in my lib/standalone/ 
directory. Example:

/var/www/myapp/lib/standalone/report_generator

/etc/init.d/report_generator start|stop|restart

My rails app communications via Unix sockets to my report_generator.

Zach