Rack Unicorn

Usar Unicorn con aplicaciones Rack es muy sencillo, para empezar, simplemente suministre config.ru e invoque unicorn.

APP_ROOT/config.ru

 1class HolaMundo
 2  def call(env)
 3    return [
 4      200,
 5      {'Content-Type' => 'text/html'},
 6      ["¡Hola Mundo!"]
 7    ]
 8  end
 9end
10
11run HolaMundo.new

unicorn

$ unicorn
I, [2012-01-08T12:26:18.626031 #8123]  INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2012-01-08T12:26:18.626528 #8123]  INFO -- : worker=0 spawning...
I, [2012-01-08T12:26:18.628099 #8123]  INFO -- : master process ready
I, [2012-01-08T12:26:18.629408 #8124]  INFO -- : worker=0 spawned pid=8124
I, [2012-01-08T12:26:18.629784 #8124]  INFO -- : Refreshing Gem list
I, [2012-01-08T12:26:18.654995 #8124]  INFO -- : worker=0 ready
...