On Wednesday, July 14, 2010 05:10:06 pm yermej wrote:
> In the past, I've done this by running a web app via WEBrick or
> mod_ruby.

Or Mongrel, Thin, Unicorn, etc -- anything Rack-based. (If you aren't Rack-
based, you should be. Sinatra makes it easy, but even Rails is built on Rack 
these days.)

But all of these are mostly performance-tuning hacks -- most don't 
fundamentally change what you're doing.

> Is there a more accepted way to handle this? Something where the web
> service client would be always running and somehow listening for a
> request?

How is that different than what you're doing?

I suppose something like mod_ruby might listen without a worker running, then 
instantiate your app when you get a request. But many other servers simply 
embed themselves into a running process -- that IS your app always running, 
waiting for a request. Unicorn combines both -- it loads your app, then forks 
it off into several workers, so you have MANY copies of your app always 
running, waiting for a request.

Maybe I don't understand what you mean by "always on"?