From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: workers created when request comes in? Date: Tue, 15 Dec 2009 18:37:01 -0800 Message-ID: <20091216023701.GA6398@dcvr.yhbt.net> References: <73096a160912151737t48f6684fhbb5f047bc187c0eb@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1260931049 19648 80.91.229.12 (16 Dec 2009 02:37:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Dec 2009 02:37:29 +0000 (UTC) Cc: unicorn list To: Joseph McDonald Original-X-From: mongrel-unicorn-bounces@rubyforge.org Wed Dec 16 03:37:22 2009 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Content-Disposition: inline In-Reply-To: <73096a160912151737t48f6684fhbb5f047bc187c0eb@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:219 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1NKjlR-0001h4-ST for gclrug-mongrel-unicorn@m.gmane.org; Wed, 16 Dec 2009 03:37:22 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id D341918582CE; Tue, 15 Dec 2009 21:37:21 -0500 (EST) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id AE7CB18582C9 for ; Tue, 15 Dec 2009 21:37:02 -0500 (EST) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id F12EE1F507; Wed, 16 Dec 2009 02:37:01 +0000 (UTC) Joseph McDonald 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 - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying