From: Giovanni Lion <giovanni.lion-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Rainbows! list" <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: rainbows for 3rd party api
Date: Thu, 5 Nov 2009 14:03:12 +0100 [thread overview]
Message-ID: <2007122a0911050503x5740cf3ei4f1185b4cb895298@mail.gmail.com> (raw)
In-Reply-To: <20091104214018.GA25942-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
> Hi Giovanni,
>
> 3rd party API responses are exactly one of the uses Rainbows! was built
> for.
>
> You really only want DevFdResponse if you're doing a straight proxy
> between the 3rd party and your client without modifying the data. Since
> you seem to be getting XML and rendering HTML, you probably can't use
> DevFdResponse efficiently. Don't despair, though, Rainbows! still
> gives you plenty of options :)
>
> You can build a Rack config.ru to use with Rails, too. In fact, you'll
> have to for now since we're unsure if we want to support a
> "rainbows_rails" wrapper like I do with "unicorn_rails". Using
> config.ru gives you much more flexibility to route around/outside
> of Rails.
Ok i think i got most of it. Now i was just thinking about the best
way to get this going. The issue now is that processing the xml into
the html is something I prefer keeping insde the app for consistency.
My idea was to do something like this, i use an example this time:
1) I get a request for a friend list html partial
2) I intercept it and using revactor
3) Wait for the response (It shouldn't be called waiting with revactor
and fibers, right?)
4) I write the response to memcached
5) I call the rails app who now fetches from cache the friend list
6) The rails app renders the partial and everybody is happy
Do you think this is a good flow? Should I create a specific method instead?
Also, another issue is not clear to me yet. I need to make api
requests with oauth, hence there is a logic layer on top of the http
request. I would probably need to brake it down and replace Net:HTTP
with Revactor::HttpClient, am i correct?
Thanks for your help
Giovanni
_______________________________________________
rainbows-talk mailing list
rainbows-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/rainbows-talk
next prev parent reply other threads:[~2009-11-05 13:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-04 18:49 rainbows for 3rd party api Giovanni Lion
[not found] ` <2007122a0911041049u2b4376dbpd3b1f727e315ea88-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-04 21:40 ` Eric Wong
[not found] ` <20091104214018.GA25942-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2009-11-05 13:03 ` Giovanni Lion [this message]
[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=2007122a0911050503x5740cf3ei4f1185b4cb895298@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).