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.0 required=3.0 tests=MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Giovanni Lion Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: rainbows for 3rd party api Date: Wed, 4 Nov 2009 19:49:33 +0100 Message-ID: <2007122a0911041049u2b4376dbpd3b1f727e315ea88@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 1257360594 25641 80.91.229.12 (4 Nov 2009 18:49:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Nov 2009 18:49:54 +0000 (UTC) To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Wed Nov 04 19:49:47 2009 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=JrQMPIW6sf5V9OK8JA4sqjPIfHtRbJz0rKkiDENbTrg=; b=W0Kng477jyUsJxonrW/4lxYnTaVEyu1vz+C3a1WchSwcEj7+oUai1PMdF0qKcsVxIs HGkjtjiM1Sxo2vPpVfCDOqw6LUCoCO1zjTAHzzuzgqtZddzeppFiiyN1t0Rf/5TLT/ge 8/VMeYybzqUH28XK9nWrfTQqtaZDncR/FBDDI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=YIU6ukHvnZtDojaBUHgA+IHgcW54PfwLCwfq+/XihvZUXnA+spHNVKnNQmqVLazlPS 1rxRU9c/OMXX+/n6fsapWFrqaeMB/IDRv7K44u8Z5pTsdiozfEDU8SzMC0Gy7BhzZG1S wEveHbVsDE+ezKAmJkQTl04dI+r1t2h07MAd0= 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 Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:16 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1N5kvS-00037u-LQ for gclrrg-rainbows-talk@m.gmane.org; Wed, 04 Nov 2009 19:49:46 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 2A6EF185828E; Wed, 4 Nov 2009 13:49:46 -0500 (EST) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by rubyforge.org (Postfix) with ESMTP id 787D4185828E for ; Wed, 4 Nov 2009 13:49:34 -0500 (EST) Received: by bwz8 with SMTP id 8so9639723bwz.19 for ; Wed, 04 Nov 2009 10:49:33 -0800 (PST) Received: by 10.204.10.20 with SMTP id n20mr1838560bkn.161.1257360573533; Wed, 04 Nov 2009 10:49:33 -0800 (PST) Hi all, I came across rainbows while I was looking for a smart solution for handling 3rd party api calls for my rails app. I would like to know a little more about how to achieve efficency in the following context: 1 user requests a page 2 page content requires xml to be retrieved from 3rd party server through http call 3 page is rendered, without the 3rd party data but with an onload ajax request back to the app to retrieve 3rd party data 4 app generates an http call to 3rd party api 5 app waits for 3rd party response 6 app responds to ajax call rendering html out of the xml response from 3rd party api Right now my current setup is apache + passenger, no constraints on switching to anything else. This setup is not optimal of course because if i receive many concurrent requests that need 3rd party response passenger app pool is full and sleepy. From what i read in the documentation rainbows should come handy in this situation. I had a look at unicorn and i think i got more or less how it works. Can anyone suggest me how to set up the app deployment in order to reduce waste on step 5? My guessing is should create a rack app to handle these calls using DevFdResponse and run it with rainbows. Only problem is can i have the rails environment in there? Thanks in advance, Giovanni