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: AS33070 50.56.128.0/17 X-Spam-Status: No, score=2.4 required=3.0 tests=DATE_IN_PAST_03_06, MSGID_FROM_MTA_HEADER,RDNS_NONE shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: Alexandre Riveira Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: c10k paradigm [SOLVED] Date: Tue, 16 Apr 2013 20:27:18 +0000 Message-ID: <516DB426.8020602@objectdata.com.br> References: <516BE872.5060006@objectdata.com.br> <20130415183011.GA27317@dcvr.yhbt.net> <516C2A48.3070808@objectdata.com.br> <20130415193403.GA742@dcvr.yhbt.net> <516D338C.9060408@objectdata.com.br> <20130416172417.GA12658@dcvr.yhbt.net> <516D6A0C.50406@objectdata.com.br> <20130416183500.GA10540@dcvr.yhbt.net> <516D882B.4070402@objectdata.com.br> <20130416204813.GA15083@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1366154857 32146 80.91.229.3 (16 Apr 2013 23:27:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Apr 2013 23:27:37 +0000 (UTC) To: "Rainbows! list" Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Wed Apr 17 01:27:37 2013 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=slaLpomIAKX/ywYgcPclRXWttmikdbeTQXbpbd+TZDM=; b=n7zlSnMmmH6MOMJYQH4/bIsCWv2jKd95wtwZCGp0AYEBldyqniLT/9mSlsQVZlyJBK VZbtCS7kg+UkTYkCxAnqVRQ0ebVJJnDrbQtNoRQgbvHT28dT/h0pTm3M7jqkIKaTBhNJ ZMXyaWHiZkSiaRHgt2/J/NgLyHeSzxwLI2PxOiOQiiBmddrNTlL2m0wCQX8hnRcuniXu 1c1JWaVavq8PhydfIyAQjVbYSR4WeDYB/mDr2YTFSMcXukDywR1WSvjlOQDRQAbQwFbO Y/Eyy+gEBKDpPcNZiGnG3iubRe1j/qDWg3aCX0G3nbNKk2Fy3VxdeC/RY1T4tWJCQ6yp 12dg== X-Received: by 10.236.197.196 with SMTP id t44mr2224520yhn.73.1366154842542; Tue, 16 Apr 2013 16:27:22 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: <20130416204813.GA15083-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> X-Gm-Message-State: ALoCoQms9iCo/5lY8qx/mUzYmzRRtAZ8pWGl9iyDDmsDA0Z3oXn1dOxDmItoc7DJuYrU5HiJoq9B X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Broken-Reverse-DNS: no host name found for IP address 50.56.192.79 Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:480 Archived-At: Received: from [50.56.192.79] (helo=rubyforge.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USFHh-0007F0-I2 for gclrrg-rainbows-talk@m.gmane.org; Wed, 17 Apr 2013 01:27:33 +0200 Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 7FA402E0F2; Tue, 16 Apr 2013 23:27:33 +0000 (UTC) Received: from mail-ye0-f174.google.com (mail-ye0-f174.google.com [209.85.213.174]) by rubyforge.org (Postfix) with ESMTP id 5AF282E0F2 for ; Tue, 16 Apr 2013 23:27:24 +0000 (UTC) Received: by mail-ye0-f174.google.com with SMTP id l2so167219yen.33 for ; Tue, 16 Apr 2013 16:27:22 -0700 (PDT) Received: from [192.168.1.7] ([177.41.215.227]) by mx.google.com with ESMTPS id o31sm5110279yhh.21.2013.04.16.16.27.21 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Apr 2013 16:27:21 -0700 (PDT) Tanks for all helpers. Erick, this solutions CheckDefered is pefect !And run in production ! 1) rack middleware class CheckDeferred def initialize(app) @app = app end def call(env) @app.call(env) end def deferred?(env) case env["PATH_INFO"] when /\/ecommer.*/ false else true # erp run by thread end end end 2) edit your config.ru require File.expand_path "config/environment" use CheckDeferred #first if not function use Rails::Rack::LogTailer use Rails::Rack::Static run ActionController::Dispatcher.new Alexandre Riveira Em 16-04-2013 20:48, Eric Wong escreveu: > Alexandre Riveira wrote: >> Em 16-04-2013 18:35, Eric Wong escreveu: >>> See what Mark just said. Also, t/app_deferred.ru in the rainbows >>> source[1]. There's also a link to Ezra's old post about it in the >>> TryDefer documentation. >>> >>> [1] - git clone git://bogomips.org/rainbows && $EDITOR t/app_deferred.ru >> In file ems/rainbows-4.5.0/lib/rainbows/event_machine.rb line 74: >> server.app.respond_to?(:deferred?) >> server.app is a Rails::Rack::LogTailer class. >> >> should not be ActionController::Dispatcher.new or like ??? > You should probably write a new middleware around/outside of your > normal Rack layer. Something like this: > > class CheckDeferred < Struct.new(:app) > def deferred?(env) > case env["PATH_INFO"] > when %r{/manager/}, > %r{/foo/bar}, > ... # whatever other paths you want multithreaded > true > else > false > end > end > end > > ----------- config.ru -------------- > use CheckDeferred # needs to be the outermost layer of middleware > > use ... > run Application.new > ------------------------------------ > _______________________________________________ > Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org > http://rubyforge.org/mailman/listinfo/rainbows-talk > Do not quote signatures (like this one) or top post when replying > _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying