[Mongrel] http parser

snacktime snacktime at gmail.com
Sun Aug 20 16:50:03 EDT 2006


On 8/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote:
> On Sun, 2006-08-20 at 02:50 -0700, snacktime wrote:
> > Just thought I'd let you know that your http parser worked great for
> > creating an http protocol handler for Eventmachine.  It wouldn't take
> > that much effort to use Eventmachine for Mongrel, might be worth a
> > shot just to see how it does.  A few things would need to be
> > restructered, like HttpRequest where you read the rest of the body,
> > and calling the handler.  But it wouldn't be all that much work I
> > don't think.  Took me about an hour to create a working http server
> > with Eventmachine, your parser, and subclassing HttpRequest to get rid
> > of the socket reading.  I'll spend some more time on it tommorrow and
> > see how it progresses.
>
> The EventMachine stuff doesn't really buy you much since they use Ruby's
> select still to process connections.

I didn't realize that.  I thought they used a native select.  If
that's the case then EM would actually perform worse, since you are
always grabbing threads from a pool to run blocking operations and
then jumping back into the event loop.  I do like how you did your
parser though, it would be easy to drop that into pretty much any ruby
project that needs an http parser.

Chris


More information about the Mongrel-users mailing list