From: zedshaw@... Date: 2005-08-10T06:55:31+09:00 Subject: Re: event driven framework for ruby Depending on the libevent API used, all of the actual socket reading/writing is either done with Ruby's Socket API, or it's done by libevent. The only additional bit of "magic" I do is to turn off blocking. Incidentally, none of this works with $stdout, $stdin, $stderr and probably doesn't work with files. Most likely that's because Ruby is messing with things it shouldn't be messing with . This all works because libevent only deals with the OS level event API and the direct socket file descriptor (Socket.fileno). So, with non-blocking sockets combined with libevent, we only access the Ruby Sockets API when there's actually something to read. Additionally, Myriad is layered on top of the libevent bufferevent structure, so libevent actually does *all* of the IO and we just have to read chunks of memory data. This gets around a ton of performance bottle-necks and interference from Ruby Sockets. I'll hopefully have a more detailed explanation when I release later this week. Zed A. Shaw http://www.zedshaw.com/ > On Aug 9, 2005, at 12:23 PM, zedshaw@zedshaw.com wrote: > >> Actually, yes. I'm working on the Ruby/Event library. It's a C >> extension >> for libevent. I built a small framework on top of this called Myriad >> which is similar to twisted and POE. I used Myriad to write the SCGI >> client/server which can host Ruby on Rails applications. > > Does this do all it's socket work in C, to bypass Ruby's Thread > blocking issues? > > James Edward Gray II > > >