Joseph McDonald <[email protected]> wrote:
> Is it possible to have unicorn spawn a new worker when a request comes
> in, and only allow that child to service the one request?
>
> In development mode it would be nice if I could just save my changes
> and know that I will see them right away without having to HUP the
> server.
Hi Joseph,
Yes, just send SIGQUIT to yourself anywhere inside the application
dispatch and it'll defer the exit until your application is done
processing.
You should be able to just make it middleware like this:
# name inspired by the "shotgun" gem
class Unicorn::Shotgun < Struct.new(:app)
def call(env)
Process.kill(:QUIT, 0)
app.call(env)
end
end
--
Eric Wong
_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying