Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Giovanni Lion <giovanni.lion-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
Subject: rainbows for 3rd party api
Date: Wed, 4 Nov 2009 19:49:33 +0100	[thread overview]
Message-ID: <2007122a0911041049u2b4376dbpd3b1f727e315ea88@mail.gmail.com> (raw)

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

             reply	other threads:[~2009-11-04 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-04 18:49 Giovanni Lion [this message]
     [not found] ` <2007122a0911041049u2b4376dbpd3b1f727e315ea88-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-04 21:40   ` rainbows for 3rd party api Eric Wong
     [not found]     ` <20091104214018.GA25942-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2009-11-05 13:03       ` Giovanni Lion
     [not found]         ` <2007122a0911050503x5740cf3ei4f1185b4cb895298-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-05 23:06           ` Eric Wong
     [not found]             ` <20091105230638.GA7131-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2009-11-06 10:40               ` Giovanni Lion
     [not found]                 ` <2007122a0911060240j105c1fcfgfebb2c5757cf7fd1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-06 19:20                   ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2007122a0911041049u2b4376dbpd3b1f727e315ea88@mail.gmail.com \
    --to=giovanni.lion-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).