Charles Oliver Nutter
5/14/2009 3:08:00 PM
Brian Candler wrote:
> Brian Candler wrote:
>> I don't see in principle why it couldn't be done - I guess you just fork
>> the process when a request comes in. The messy bit is passing the
>> stdin/stdout/stderr file descriptors over a socket. And it could be
>> called "railgun" :-)
>
> It turns out all the messy passing of IO objects is already included in
> the Ruby standard socket library, so without further ado, here's a
> working proof-of-concept :-) Tested under ruby 1.8.6p111
This is essentially the magic behind Passenger, which also manages the
child processes and balances requests across them. So yeah, it's doable
and not too peculiar.
- Charlie