--00504502c3961a3b5504957659fc
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 19, 2010 at 7:13 PM, Eric Wong <normalperson / yhbt.net> wrote:

> Heh, I don't actually have much a clue what interests people when it
> comes to async apps, I barely use the web myself.
>

Yet you've written over 9000 HTTP servers... lol


> I would imagine it's like writing any regular application with
> Rev/Revactor, you could make async HTTP requests to other backends and
> maybe some databases with adapters for them...
>

Well, as a particularly useful example... how would you write an HTTP proxy
that used Rainbows! as the server and Rev as the client? Rev has an
asynchronous HTTP client... how would you handle an incoming HTTP request in
Unicorn, make an async HTTP request with Rev's client, then stream the
response back to the client? Or vice versa for an upload server (e.g.
imagine an HTTP server that uploads files to S3)

How would you write something like that with Rainbows
As a more interesting example, Revactor implements a synchronous HTTP client
which is backed by fibers. How could you write a Rainbows! async HTTP server
that streamed the responses to a listening actor in the form of inter-Actor
messages?

I had an idea for an app I wanted to write as a demo for my RubyConf talk
but I never dug into Rainbows! and figured out how. It was to be called the
"Warholizer". I wanted to have an HTTP client connected to the Twitter
streaming API, monitoring for the hashtag #warholize. When a new result
occurs, the Warholizer will perform a google image search for the text
included in the Tweet, or rather 4 searches in parallel... for the given
search term in 4 preselected colors. Once complete it can HTTP push the
result to a long polling HTTP client, which sits there in the browser and
dumps the results for new tweets into the page.

How would I get started on an app like that?

-- 
Tony Arcieri
Medioh! A Kudelski Brand

--00504502c3961a3b5504957659fc--